PagePermissions class

Adds various permission methods to Page objects that are used by Process modules.

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the PagePermissions class also inherits all the methods and properties of: WireData and Wire.

Show class?             Show args?        

Common

NameReturnSummary 
PagePermissions::addable(HookEvent $event)
(nothing)Can the current user add child pages to this page? 
PagePermissions::deleteable(HookEvent $event)
(nothing)Is the page deleteable by the current user? 
PagePermissions::editable(HookEvent $event)
(nothing)Hook that adds a Page::editable([$field]) method to determine if $page is editable by current user 
PagePermissions::fieldEditable(Page $page, $name)
boolIs the given field name editable? 
PagePermissions::fieldViewable(Page $page, $name)
boolIs the given Field or field name viewable? 
PagePermissions::listable(HookEvent $event)
(nothing)Is the page listable by the current user? 
PagePermissions::moveable(HookEvent $event)
(nothing)Is the given page moveable (i.e. change parent)? 
PagePermissions::pageEditable(Page $page)
boolIs the given page editable? 
PagePermissions::publishable(HookEvent $event)
(nothing)Is the page publishable by the current user? 
PagePermissions::restorable(HookEvent $event)
(nothing)Is page restorable from trash? 
PagePermissions::sortable(HookEvent $event)
(nothing)Is the given page sortable by the current user? 
PagePermissions::trashListable()
boolReturn whether or not given page in Trash is listable 
PagePermissions::trashable(HookEvent $event)
(nothing)Is the page trashable by the current user? 
PagePermissions::userCanAssignRole($role)
boolCan the current user add/remove the given role from other users? 
PagePermissions::userEditable($page)
boolReturns whether the given user ($page) is editable by the current user 
PagePermissions::userFieldEditable($name)
boolIs the given field editable by the current user in their user profile? 
PagePermissions::userViewable($page)
boolReturns whether the given user ($page) is viewable by the current user 
PagePermissions::viewable(HookEvent $event)
(nothing)Hook for Page::viewable() or Page::viewable($user) method 

Additional methods and properties

In addition to the methods and properties above, PagePermissions also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #553
    In the 553rd issue of ProcessWire Weekly we'll check out the latest weekly update from Ryan, introduce a new third party module called Text Synthesis, and more. Read on!
    Weekly.pw / 14 December 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“I am currently managing a ProcessWire site with 2 million+ pages. It’s admirably fast, and much, much faster than any other CMS we tested.” —Nickie, Web developer