Role::addPermission() method

Add the given Permission string, id or object.

This is the same as $role->permissions->add($permission) except this one will accept ID or name.

Usage

$bool = $role->addPermission($permission);

Arguments

NameType(s)Description
permissionstring, int, Permission

Permission object, name or id.

Return value

bool

Returns false if permission not recognized, true otherwise


Role methods and properties

API reference based on ProcessWire core version 3.0.244

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani