Tell us what you are trying to do?
Is there a tutorial or example of best way to limit access to a specific set of CPT instances to a specific user. They may or may not be the author.
The use case here is similar to woo-commerce. A user can only see their own orders.
In this case, we will have a set of custom posts that will be linked to a specific user. We will have a page that only displays the ones they have access to.
Be great if Nigel can pick this up.
Hello,
There isn't such kind of built-in feature within Toolset plugins.
In your case, as a workaround, you can consider to setup many-to-many relationship between WordPress users and posts:
https://toolset.com/documentation/legacy-features/views-plugin/how-to-create-custom-searches-and-relationships-for-users/
For example:
1) Create a custom post type "Member", one user has only one "Member" post, each "Member" post's author is different WP user.
2) Setup many-to-many relationship between "Member" and your "CPT"
3) Edit each "CPT" post, connect it with other "Member" posts
4) After user login your website, show him a WP page, in this page display a nested view:
a) Parent post view:
- Query "Member" posts
- Filter by post's author is same as logged-in user
- In views' loop display below child post view
b) Child post view:
- Query "CPT" posts
- Filter by post type relationship between "Member" and your "CPT"
- In views' loop, display "CPT" information
Thanks Lao. Kind of what I thought. Thanks for pointers on approach.
Be nice if the dev team considered. It would unlock a range of applications.
Toolset Access plugin is based on WordPress Roles and Capabilities, see WP document:
https://wordpress.org/support/article/roles-and-capabilities/
There isn't such kind of built-in feature within WordPress too, so I don't think we can add such feature into Toolset Access plugin, but you can add a feature request for it, our developers will evaluate it.
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/