Skip Navigation

[Resolved] Limit users to viewing only their own posts

This support ticket is created 5 years, 1 month 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
#1214795

Hi there.

I am trying to achieve the following:

1. Clients get access to the website to submit their design briefing (no problem)
2. We setup a custom post type called 'design worksheet' for clients to complete on the front end (no problem)
3. These posts once submitted should only be readable by site admins and the user who submitted the 'design worksheet' post, as it includes information confidential to that client.

Can you please help me to achieve that?

Many thanks for your time,
Andrew.

#1214821

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Andrew,

Thank you for contacting our support forum.

Given that the users will have a specific role, you can use our access plugin to restrict users of that role to reading and editing their own.

Take a look at the link below as this should be able to give you an overview of how this work.
https://toolset.com/documentation/user-guides/setting-access-control/#managing-access-control-for-posts-pages-and-custom-post-types

Thanks,
Shane

#1214850

Hi Shane,

Unfortunately I don't think that's true (although I am happy to be proven wrong).

There is the ability to edit own, yes. But there is not the ability to only read own - just the ability to read all or none of the posts of that post type.

Can you clarify this, please? I need some way of having submitted posts only readable by admins and the person submitting them, as they are for job briefs.

Thank you for your time,
Andrew.

#1216561

Hi, Shane is out on holiday this week so I'm checking in on his tickets. If I understand correctly, it might be practical to use the "private" post status in the Design Worksheet Form settings. This creates private posts that are only visible on the front-end to the author of that post (and site admins). There are some limitations you should be aware of. By default, private posts will not appear in a View unless you add a post status filter. But then, all private posts appear for everyone in that View (not just the current logged-in User's private posts). You can work around that by using post author ID filters and shortcode attributes. You should familiarize yourself with passing arguments to Views: https://toolset.com/documentation/user-guides/passing-arguments-to-views/

Let me know if you have questions about this.

#1217689

Thanks Christian.

When you suggest the following, can you explain a little more on what would happen:

all private posts appear for everyone in that View (not just the current logged-in User's private posts). You can work around that by using post author ID filters and shortcode attributes.

If we did this successfully, would users only be able to see their own posts, or would they only have their own listed? By that I mean, even though a user is only seeing their own posts listed, would they still be able to view other users' posts if they managed to guess a url, for example? That would not be acceptable as these must be entirely private between the user and admins.

Thanks for your time,
Andrew.

#1218405

If we did this successfully, would users only be able to see their own posts, or would they only have their own listed?
Both, if done successfully with author ID and shortcode attributes. Even if they guessed another User's private post URL, they would see a 404 error at that URL. There would be no indication that this post exists, either in the View or in the site URL structure. Hope this helps!

#1218529

Thanks Christian. I'm going to give this a go and report back.

Would the client and site admins still be able to comment on the post if it is set to private?

Very best wishes,
Andrew.

#1219203

Yes, that's correct. The author and site admins will be able to comment on private posts using the native WP comment system.

#1323225
Screen Shot 2019-08-23 at 18.37.13.png

Hi there. I really hope you can help me to pick back up on this.

I have filtered by author, and all posts are set to publish as Private posts. But still authors from the front end cannot see their post in Views.

I know that I need to follow this advice you have above: "By default, private posts will not appear in a View unless you add a post status filter. But then, all private posts appear for everyone in that View (not just the current logged-in User's private posts). You can work around that by using post author ID filters and shortcode attributes."

I have tried this again and again, using the advice on the linked page, and I just can't figure it out.

Please can you help me by telling me what settings I need to use in the dialogue shown in the attached screenshot to achieve my aim. As things stand, Admins see their private posts in the View, but members (front end subscribers) do not see theirs.

Thank you so much for your time.

Very best wishes,
Andrew.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.