$user→removeRole()
Remove Role from this user
This is the same as $user->roles->remove($role) except this one will accept ID or name.
Example
// Remove the "editor" role from the $user
$user->removeRole('editor');
$user->save();Usage
$bool = $user->removeRole($role);Arguments
| Name | Type(s) | Description |
|---|---|---|
$role | string int Role | May be Role name, object or ID. |
Return value
boolfalse if role not recognized, true otherwise
API reference based on ProcessWire core version 3.0.252