Skip Navigation

[Resolved] Allow administrators to read private posts

This thread is resolved. Here is a description of the problem and solution.

Problem: I have set up a private post type called "Members." I would like to allow Admin users to read private Member posts.

Solution:
- Activate Toolset Access
- Go to Toolset > Access Control > Post Types and bring the native Posts type under Access control. Modify the configurations as needed.
- Go to Toolset > Access Control > Custom Roles and hover over Administrator role. Click "Change permissions", then go to the "Custom capabilities" tab. Add "read_private_members" and save.
- Refresh the Member page on the front-end of the site.

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#908828
Screenshot 2018-06-05 at 7.51.48 AM.png

I am trying to: control access to certain member listings

Link to a page where the issue can be seen: hidden link

I expected to see: filtered member list (the 'Test Member' should not show when not logged in)

Instead, I got: all members listed

Ticket submitted by Toolset contractor Chuck Gregory on behalf of Brendan Moran

#909116

Hi, Access is designed to help you hide content on a post in a restricted post group, but restricted post titles may still appear in search results or View results. Unfortunately there's not a great way to hide restricted posts from View or Archive results right now. The only option is to use inline access_control shortcodes in the Loop Output, but this can be problematic if your View or Archive uses pagination because the conditionals will cause inconsistent counts.

Our developers have a feature request in place that will integrate Access and Views like this, but I don't have a timeline for its delivery. The best place to keep up with new feature releases is our blog: https://toolset.com/blog

#910609

Thank you for your reply. I finally realized that what I was describing could be accomplished by changing the wordpress visibility for the member posts that needed to be protected. By making these private, I not only hid the posts themselves but also removed them from lists.

But...

This had the effect of hiding the posts for everyone. Even admin. I messed with settings in access, even went so far as to enable 'read private posts' and 'read private pages' for everyone except guests. No help.

In a last-ditch effort I decided to deactivate the Toolset Access plugin. And now everything works.

So, I need help figuring out what happened; is this a huge bug or did I do something wrong. I'm leaning toward bug. We do have a working solution on the site but I've checked 'I still need help' because I think this is an issue with the plugin that needs to be resolved.

Thanks, Chuck.

#910739

The permissions for reading private posts are specific to the post type. So if your Member post slug is "member" you will have to add a custom capability "read_private_members" in the Change Permissions dialog with Access active.

#911331

That did not work

#911537

May I log in to your site to see what's going on? Please provide login credentials in the private reply fields here.

#911870
member.jpg

Seems to be working for me. I believe you need to bring the native Posts type under Access control to see the changes applied to custom post types. Here are the steps I took, and a screenshot of the results attached:
- Activate Toolset Access
- Go to Toolset > Access Control > Post Types and bring the native Posts type under Access control. Modify the configurations as needed.
- Go to Toolset > Access Control > Custom Roles and hover over Administrator role. Click "Change permissions", then go to the "Custom capabilities" tab. Add "read_private_members" and save.
- Refresh the Member page on the front-end of the site.

I reverted all of these changes for now.

#913136

Thank you for the detailed instructions. It works.