Skip Navigation

[Resolved] Control Access by Term

This support ticket is created 6 years, 5 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.

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 5 months ago.

Author
Posts
#953798

Ian

Tell us what you are trying to do?

I have a website that is using a taxonomy to break the site into 4 sections,
The taxonomy is "Sections"
with the terms Office, Recreation, Economic Development, Fire Department these terms correspond to the local government structure.
The taxonomy currently works with the post-types; Posts, Pages, Projects & more will be added as the site grows.

I want to let workers from the "Fire Department" to only be able to add, edit, delete Posts, Pages & Projects with the term fire_department.

I am currently using plugins that:
• Add the section term to the permalink
• Change the main menu based on the term

I also have the term being written to the body css so I will be able to style each section.

#954399

Are you planning to do that on the backend?
That may be tricky, as especially Toolset Access will not allow granulated control over shared taxonomies, and even less, conditions over who can edit the posts connected to it.
It's rather about who can assign that term(s) than who can do what with things that are connected to.

So, this would be better to be done on the Front end with Toolset Forms.

For example you can create Forms to edit those posts.
Then, create Views that list the Posts as in each term/user combination.
You can use Query Filters in the View to return only posts that are belonging to a term.
Then you wrap that entire View (or it's loop) in a Access ShortCode or HTML condition, that checks in the user role and show it only if appropriate

You can do the same with an add form, where you place the form on a bag and show it only to the ones who should

Here are a few links to further details:
https://toolset.com/documentation/user-guides/access-control-texts-inside-page-content/
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/