The $user API variable is a type of page representing the current user, and the User class is Page type used for all users.
Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the
User class also inherits all the methods and properties of: Page, WireData and Wire.
|Add Role to this user|
|$user->email||Get or set email address for this user.|
|Get this user’s permissions, optionally within the context of a Page.|
|Does the user have the given permission?|
|Does this user have the given Role?|
|Is this the non-logged in guest user?|
|Is the current user logged in?|
|Does this user have the superuser role?|
|$user->language||User language, applicable only if LanguageSupport installed.|
|$user->pass||Set the user’s password.|
|Remove Role from this user|
|$user->roles||Get the roles this user has.|
These methods are only useful for hooking and should not be called directly.
|Does this user have named permission for the given Page?|
$user->hasTemplatePermission(string $name, $template)
|Does this user have the given permission on the given template?|
Additional methods and properties
In addition to the methods and properties above, User also inherits the methods and properties of these classes:
API reference based on ProcessWire core version 3.0.66