pwFoo Posted April 29, 2019 Share Posted April 29, 2019 Hi, I try to add page-edit-own and page-delete-own permissions, but it's strange... If a add the custom permissions it looks like both are children of page-edit respectively page-delete. I played with added / revoked permissions, but I can't get it work, that a user of a role just can delete own content. First the user can't delete any content and now the user can delete own and foreign pages ? Is there a tutorial to learn more about the PW permissions? Or do I have to rename the permissions to page-own-edit and page-own-delete to be independent from page-edit and page-delete? Link to comment Share on other sites More sharing options...
Robin S Posted April 29, 2019 Share Posted April 29, 2019 On 4/29/2019 at 9:09 PM, pwFoo said: I try to add page-edit-own and page-delete-own permissions Expand There are predefined system permissions for this - you just have to install them: https://processwire.com/docs/user-access/permissions/#page-edit-created https://processwire.com/docs/user-access/permissions/#page-edit-trash-created 2 Link to comment Share on other sites More sharing options...
pwFoo Posted April 30, 2019 Author Share Posted April 30, 2019 Thanks! Tested the permissions, but have a problem with permissions or understanding how it works. "page-create" is activated for "basic-page". Don't know if needed... just activated to test... My role has the following permissions set. Tried to add a page to home ("/") with template ""basic-page". Do some permission check before... Page owner: test Current user: test Current user roles: guest, writer Current user permissions: page-view, page-edit // --> missing allowed permissions "page-edit-created, page-edit-trash-created" Addable (parent): 0 // --> 1 (allowed to add child to "/") Addable (child to page): 0 // --> OK, add to parent should work, not add children to that page Editable: 1 // --> OK, but by page-edit or as should page-edit-created??? Trashable: 0 // --> 1 (allowed by page-edit-trash-created) Deleteable: 0 // --> OK, just allowed to trash the page... User test has role "writer" (screenshot with permissions), is page owner(!). Added expected values to the permission check output above. Checked by addable(), editable(), trashable() and deleteable() methods. Link to comment Share on other sites More sharing options...
gmclelland Posted April 30, 2019 Share Posted April 30, 2019 pwFoo your uploaded image is broken 1 Link to comment Share on other sites More sharing options...
pwFoo Posted April 30, 2019 Author Share Posted April 30, 2019 Hi @gmclelland, strange... Image isn't broken here, but I changed the post a short time later because I fixed it... The changes are gone, just the "solved" tag is there. Problem was that the page was moved to trash and so parent wasn't home ("/") anymore. So different permissions and trashable == false was "fine". I moved the page back and all looks good. Link to comment Share on other sites More sharing options...
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