Restrict access to custom post types

I am trying to completely hide content for a custom post type (private to a certain group). I'm not sure if Membership 2 supports this. I enabled the "Individual Custom Posts" Add-On, but it seems to want me to manually select all the posts of the type. There are thousands, and I can't manually keep up with assigning them private. Is there a way to say "I want all posts of this type automatically restricted to these groups?". I've seen other plugins and tutorials to restrict who can edit a post type (though I'm not sure the best direction to go there either) but what I am trying to do is completely hide these private post types to all but the members of a group. So if I have a list of anything, I don't want other members to have any access to the post title even, even if they know the URL. Ideally I would like to make a matrix of permission, that certain groups/roles can have CRUD abilities for their own posts, some complete read/write for certain categories only, and some read-only and some not even view access (including hiding the post titles from searches or direct URL viewing). I am using Pods currently to create and manage custom post types, if that matters. The end result matrix I am trying to assign is what groups have what access (create/update/delete, read-only or none) for what post-types and categories (entries assigned with certain categories only viewable to members of the certain groups as well, if possible). Some members will only have access to search/create/read/update/delete their own personal entries and assign whatever category they want to their own entries.
Can you let me know if Membership 2 supports these dimensions and give me some direction for this setup, or send me in the right direction for another solution, since I seem to be finding options to manually select posts of a certain type, not the whole type. I may just not be understanding something too. I am open to switching from Pods if a different custom post type solution might be more tailored for this purpose.
Thank you!

  • Aurelio

    Uhm. Now I'm embarrassed. I totally forgot about custompress. Is it pretty much the same in terms of these permissions? I have a lot built in Pods but would try to migrate if needed. Maybe I just need to understand better how to assign read/write/list permissions for various post types? With Membership2 it seemed like I had to define post by post but maybe I'm just overlooking something simple?
    thanks for your patience.

  • Nithin

    Hi Aurelio,

    Hope you are doing good today. :slight_smile:

    If you disable Individual Custom Posts add-on, you can protect custom post types according to it's post type, under Membership 2 > Protection Rules > Custom Post Types.

    I think the above should help achieve what you are looking for, please let me know if I have missed out anything, have a nice day. :slight_smile:

    Kind Regards,

  • Aurelio

    Thank you so much Nithin! That works beautifully for protecting the custom post type. I was making it more complicated by turning on the Individual Custom Posts add-on. One quirk I noticed, is that I was using the ProfilePress Lite plugin to avoid the Wordpress branded login.php page, and when I activate Membership 2, by default, at least without some research and fiddling, the users do not have permission to log out anymore. Clicking logout keeps sending me to a restricted content notice without logging me out. I was able to log out by disabling either Membership 2 or ProfilePress Lite, and then turn it back on and test to see that the content was restricted from guests though! I may just try to theme and style the wp-login.php file instead of using a plugin to manage logins but wanted to let you know the progress and thank you very much!

  • Rupok

    Hi Aurelio,

    Thanks for confirming that you main issue is resolved now. Glad to hear that.

    Now, regarding the compatibility issue, can you please create a new thread as this is a completely different topic? Our super awesome Support Staffs will jump in that thread very soon after you create and will help you in resolving that.

    Having different threads for different issues helps both you and us to track down the solution faster. I hope you understand.

    Please let us know if you have any further inquiry. We will be glad to help.

    Have a nice day. Cheers!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.