Jump to content
pwFoo

Custom permissions page-delete-own and page-edit-own

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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.

image.thumb.png.1ae081b9e48745edccbd57d9b81293bd.png

 

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Peter Troeger
      Hello 🙂
      I have set up pagination on a mulitlanguage site.
      I've done this before, but this time I have a problem I can't solve.
      Pagination is activated on 'parent-template' and 'child-template' just to be sure 🙂
      This is my code:
      $children = $page->children('limit=1'); foreach($children as $child) { $title = $child->title; echo $title; } echo $children->renderPager(); The navigation is output correctly and the link look correct as well 'parent-page/page2/'.
      But when I click the link, the site seems to redirect back to 'parent-page/
      Any help would be greatly appreciated 🙂
      - Peter
    • By Jens Martsch - dotnetic
      Hi guys I need an estimate for the following task:
      I developed a job candidate application in ProcessWire and need an extension to a Lister Pro Page.
      My customer wants to display a summary table of the filtered data like in the attached screenshot.
      When you filtered the view, that summary should show how many candidates have which status according to the actual filtered view.
      If you change the filter, the summary table has to be updated also.
      Who can accomplish this task and what would it cost?
      I first need an estimate to tell it to my customer. If he says the price is ok I will provide you with FTP Data to a dev server version of  that tool.
      Thank you in advance.

    • By lenoir
      Is it possible to let people edit a page without having to have a user-role?
      My case is the following:
      Visitors fill in a form (Formbuilder) which is saved to pages. They get a confirmation email which could contain a unique editing link. In case they need to update some information, they can click on this link, edit the fields and save. 
      Am I totally off? Is there a better practice? 
    • By DV-JF
      Hi, 
      I'm using this kind of setup (https://processwire.com/blog/posts/language-access-control-and-more-special-permissions/#language-page-edit-permissions) in order to control the page edit permissions. Now I'm wondering if it's possible to hide the "none-ediable" language-tabs instead of striking them through.

      Many greets...
       
    • By Kiwi Chris
      I have a role that has page edit, view, and clone permissions on a specific template.
      If a page using the template is locked by a user in a role with lock/unlock permissions on the template , the only button alongside it in the page tree is view, for users who don't have lock/unlock permissions.
      If however, I also give the role page-lock permission on the template, they then get additional buttons, edit, copy, and unlock.
      I don't actually want to give this role unlock permissions, but I do want the copy (clone) button to display alongside the page in the page tree.
      Elsewhere, I've discussed how I've worked out how to create a hook to unlock the copy, but I want to keep the original page so a user without lock permissions can't unlock from the page tree it to make changes.
      Question: What method should I hook into to intercept any attempt to change the lock status?
×
×
  • Create New...