Does the system have a permission with the given name?

Example

// Check if page-publish permission is available
if($permissions->has('page-publish')) {
  // system has the page-publish permission installed
}

Usage

$bool = $permissions->has(string $name);

Arguments

NameType(s)Description
$namestring

Name of permission

Return value

bool

True if system has a permission with this name, or false if not.


$permissions methods and properties

API reference based on ProcessWire core version 3.0.115