Jump to content

permission to edit only certain children


Manol
 Share

Recommended Posts

Happy Christmas.

    I'm developing a site, it follows this structure:

cities

----city1 (city template )

--------building1 (building template)

--------building2

--------building3

--------building4

----city2

--------building1

--------building2

----city3

--------building1

--------building2

--------building3

--------building4

...

then I've got roles city1, city2, city3 ...

My question  is:

I wish users with role city1 to be able to edit only buildings within its city role but not others, is it possible without a hook?

Thank you.

Link to comment
Share on other sites

Er ...I think this is a case of multiple templates.

So, each City would have its own template and then you can give the permissions to each of those templates. The children pages inherit permissions from the parent template.

You would need to try that to see whether all the children having the same template but different parent template pages get their permissions logically - I think they do.

  • Like 1
Link to comment
Share on other sites

Thanks Joss it could be an approach but rather will look for a different solution because I need all cities to have the same template.

I may be way off here but I think Joss meant to use the cities' templates to control permissions; design-wise, the templates wcould be equivalents if you wanted to. Maybe you have other reasons why you want to use one (literal) template for all cities....?

Edited by kongondo
  • Like 1
Link to comment
Share on other sites

I'm using the same template because sometimes I need to look for all cities (template=city) and they don't share the same father, if so I would get cities->children() but is not the case.

In any case thank you for your help I'm reconsidering moving all cities under the same father so I could use your approach which is simple and simplicity is in most cases the best solution.

Link to comment
Share on other sites

I created this module http://modules.processwire.com/modules/page-edit-per-role/ exactly (almost) for this purpose. My use-case was that I needed to give users edit/add permissions on certain branches (sections) of the site - regardless of template. I believe this is also what you are looking for.

There is also another module referred to by @soma http://processwire.com/talk/topic/3629-page-edit-per-role/?p=35510 which is another way of doing it.

Anyhow, I hope these links will help you find what you need.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...