Taxonomy Terms Permissions

Topics: Administration, General
Oct 28, 2014 at 8:17 PM
Hi there,

New to Orchard here and looking at implementing it at my organization.

Is it possible to put users into groups based on our org structure and then only allow those groups to edit pages within a taxonomy? For example, I create an IT user group and they can only create/edit pages in the IT taxonomy whereas Personnel can only edit the pages in their taxonomy.

Oct 28, 2014 at 8:53 PM

As far as I know there is no such way. But you can take a look at the Orchard.ContentPermission and implement your own part in that way.
I think you only need an "TaxonomySecured" - Part (or whatever do you want to call them) with is attachable. I think the part itself needs only a basic implementation and is only needed to identify the secured content types.

Then you need an implementation of the "IAuthorizationServiceEventHandler" Interface which checks if the part is attached and if so check if the UserGroup matches the taxonomy term (Maybe you need some sort of adminsettings for the configuration of that).

This is just my idea and maybe there are a better solution.
Oct 28, 2014 at 9:25 PM
Thanks for the quick response!

Forgive my ignorance, but would doing what you suggested require creating a new module?
Oct 29, 2014 at 1:11 AM
The question for me is, why NOT a module. It's simple to create one and it's much cleaner then add some code somewhere in orchard. You can activate and deactivate it and if you need it in another project you only have to copy the module folder.

It's possible to add these stuff in existing Code but the beauty of Orchard lays in the extensibility and modularity. I really suggest to create a new module if you custom code.
Oct 29, 2014 at 3:42 PM
That is great, thanks!

I will start working on a new module. Are there any good examples out there you can point me to? With user permissions?
Oct 29, 2014 at 5:41 PM
Edited Oct 29, 2014 at 5:42 PM
You should take a look at the Orchard.ContentPermission Project inside Orchard and especially the IAuthorizationServiceEventHandler implementation. (Here).