I need to create a granular user permission structure that will do two things:
1. Enable users to be linked to certain terms in custom taxonomies, and be able to edit all CPT posts that are tagged with those taxonomies, regardless of which CPT the post is.
2. Enable users to create new posts, but only tag them with the taxonomies where they have permissions.
For example:
Let’s say I’ve got three CPTs: News, Farms, and Restaurants. Then I’ve got a “plants” taxonomy that has the terms Potatoes, Tomatoes, Cucumber.
Now, I have a user that’s responsible for the Potatoes. They can edit anything that has to do with potatoes, regardless of if it’s potato news, potato farms, or potato restaurants. As long as it’s tagged with potato, they can edit it.
They can also create new news, farms, and restaurants, but as soon as they do, those have to be tagged with “potatoes” or they won’t be able to save/edit them.
And if someone (even they themselves, I guess) removes the term of “potato” from a post, they instantly lose their editing rights for that post.
How would you do that?
(If it’s of relevance, my site is build in Bricks / ACF Pro.)
TIA!
​
[ad_2]
For the custom taxonomy-based permission structure you’re describing, you might want to look into a combination of plugins like ‘User Role Editor’ for managing different user permissions, and ‘Members’ which also offers great control over user roles and capabilities. These plugins allow you to create custom roles and define granular permissions, which could help you manage who has access to edit certain taxonomy terms.
Another plugin that could be really useful for your case is ‘Capability Manager Enhanced’. This one lets you fine-tune the capabilities of user roles, right down to specific posts and terms, similar to the functionality you’re after. Since you’re using ACF Pro, you can also take advantage of its functions to restrict or enable access to fields and custom post types based on user roles or user IDs which should play nicely with your setup.
Setting this up might involve a bit of tinkering, and if you’re not 100% comfortable coding these more specific conditional behaviors, you might want to consider consulting with a developer who specializes in WordPress customizations. They could help you pinpoint the best solution for your unique setup. It’s a pretty interesting challenge you’ve got here — best of luck with your project!