Skip Navigation

[Resolved] Limiting to view custom post based on author

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

Problem:
The issue here is that the user wants to restrict his users to only be able to see and edit their own posts.

Solution:

To do this you can follow the instructions in our documentation in the link below.
https://toolset.com/documentation/user-guides/setting-access-control/#managing-access-control-for-posts-pages-and-custom-post-types

This support ticket is created 6 years, 9 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by rafaelL-2 6 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#625307

Tell us what you are trying to do?

let's imagine the following example

User01, role "normaluser" have 1 custom post type called "myinfo"
example.com/myinfo/privatedate03

User02, role "normaluser" have 2 custom post type called "myinfo"
example.com/myinfo/privatedate
example.com/myinfo/privatedate02

I want to avoid User02 can see the post of User01 and User02 see the post of User01.

Is there any documentation that you are following?
Yes, but I didn't found anything useful to me. I know how roles work but I can't apply because my site will have more than 100 users. I can't make a role for each one.

I think I will need to use views inside the template for "myinfo" slug , or I am missing something?

Regards

#625428

Shane
Supporter

Languages: English (English )

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

Hi Rafael,

Thank you for contacting our support forum.

If you give the roles an Edit Own privilege, then the users of that role will only be able to edit their own posts.

https://toolset.com/documentation/user-guides/setting-access-control/#managing-access-control-for-posts-pages-and-custom-post-types

Please try this and let me know if it helps.

Thanks,
Shane

#625632

Hi Shane,

Seems I don't give a correct explanation. Your solution is OK for normal situations, but I have a role who can see other post based on a custom user field so I solve using a function shortcode, then this function returns 1 is can see the content and 2 if now.

Then I register that shortcode on wp-types setting, and add is as conditional view 🙂

many thanks for your time