Jump to content

Recommended Posts

Posted

Hi,

I was wondering if there was an fast & easy method to find out if a logged in user is allowed to duplicate a given page (or create a page with the same template & parent). This should take into account the template settings and user permissions.

Is there?

Thanks,

thomas

 

Posted

Check if you have installed the ProcessPageClone (/processwire/module/edit?name=ProcessPageClone) module. 

5909edff9c454_ScreenShot2017-05-03at16_47_38.thumb.png.06b4ad17dc577960f2656b5788ac6fe9.png

This installs a few permissions:

5909ee012bc60_ScreenShot2017-05-03at16_48_02.png.baf8e7a1ce57337cc50326da1d0c23b0.png

You could check if these are stored on the role of your user.

If you want to monitor changes by users on pages be sure to look at ProcessChangeLog or MarkupActivityLog.

  • Like 3
Posted

I think this would do the job:

$cloneable = $page->parent->addable($page); // boolean true/false

Plus check that the user has the page-clone permission, as @arjen suggested.

  • Like 2

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
  • Recently Browsing   0 members

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