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 #519
    In the 519th issue of ProcessWire Weekly we'll check out a new third party module called RockForms, introduce the latest ProcessWire core updates, and more. Read on!
    Weekly.pw / 20 April 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“ProcessWire is like a breath of fresh air. So powerful yet simple to build with and customise, and web editors love it too.” —Margaret Chatwin, Web developer