Manol Posted December 27, 2013 Posted December 27, 2013 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.
Joss Posted December 27, 2013 Posted December 27, 2013 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. 1
Manol Posted December 27, 2013 Author Posted December 27, 2013 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.
kongondo Posted December 27, 2013 Posted December 27, 2013 (edited) 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 December 27, 2013 by kongondo 1
Joss Posted December 27, 2013 Posted December 27, 2013 Indeed, they can have all the same fields and you can associate any template in the backend with a different template file
Manol Posted December 27, 2013 Author Posted December 27, 2013 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.
pogidude Posted December 28, 2013 Posted December 28, 2013 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. 1
Manol Posted December 28, 2013 Author Posted December 28, 2013 Hello posidude, This is what I was looking for, I have used Soma´s module is another page but for this case yours fits me better, thank you.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now