$user->getPermissions() method

Get this user’s permissions, optionally within the context of a Page.

Example

// Get all permissions the user has across their roles
$permissions = $user->getPermissions();

// Get all permissions the user has for $page
$permissions = $user->getPermissions($page); 

Usage

// basic usage
$items = $user->getPermissions();

// usage with all arguments
$items = $user->getPermissions(Page $page = null);

Arguments

NameType(s)Description
page (optional)Page

Optional page to check against

Return value

PageArray

of Permission objects


$user methods and properties

API reference based on ProcessWire core version 3.0.228

Latest news

  • ProcessWire Weekly #498
    The 498th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 25 November 2023
  • Using date range fields in ProcessWire
    This week we'll take a detailed look at the newest addition to the ProFields set of modules: the Date Range Fieldtype and Inputfield.
    Blog / 24 November 2023
  • 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