UserAccessControlHandler::checkAccess

protected UserAccessControlHandler::checkAccess(EntityInterface $entity, $operation, AccountInterface $account) Performs access checks. This method is supposed to be overwritten by extending classes that do their own custom access checking. Parameters \Drupal\Core\Entity\EntityInterface $entity: The entity for which to check access. string $operation: The entity operation. Usually one of 'view', 'view label', 'update' or 'delete'. \Drupal\Core\Session\AccountInterface $account: The user for wh

UserAccessControlHandler::$viewLabelOperation

Allow access to user label. Type: bool Overrides EntityAccessControlHandler::$viewLabelOperation File core/modules/user/src/UserAccessControlHandler.php, line 24 Class UserAccessControlHandler Defines the access control handler for the user entity type. Namespace Drupal\user Code protected $viewLabelOperation = TRUE;

UserAccessControlHandler

Defines the access control handler for the user entity type. Hierarchy class \Drupal\Core\Entity\EntityHandlerBase uses DependencySerializationTrait, StringTranslationTraitclass \Drupal\Core\Entity\EntityAccessControlHandler implements EntityAccessControlHandlerInterfaceclass \Drupal\user\UserAccessControlHandler See also \Drupal\user\Entity\User File core/modules/user/src/UserAccessControlHandler.php, line 17 Namespace Drupal\user Members Name Modifiers Type Description De

User::setUsername

public User::setUsername($username) Sets the username of this account. Parameters string $username: The new user name. Return value \Drupal\user\UserInterface The called user entity. Overrides UserInterface::setUsername File core/modules/user/src/Entity/User.php, line 382 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function setUsername($username) { $this->set('name', $username); return $this; }

User::setPassword

public User::setPassword($password) Sets the user password. Parameters string $password: The new unhashed password. Return value \Drupal\user\UserInterface The called user entity. Overrides UserInterface::setPassword File core/modules/user/src/Entity/User.php, line 214 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function setPassword($password) { $this->get('pass')->value = $password; return $this; }

User::setLastLoginTime

public User::setLastLoginTime($timestamp) Sets the UNIX timestamp when the user last logged in. Parameters int $timestamp: Timestamp of the last login time. Return value \Drupal\user\UserInterface The called user entity. Overrides UserInterface::setLastLoginTime File core/modules/user/src/Entity/User.php, line 266 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function setLastLoginTime($timestamp) { $this->get('login')->value = $timestamp;

User::setLastAccessTime

public User::setLastAccessTime($timestamp) Sets the UNIX timestamp when the user last accessed the site.. Parameters int $timestamp: Timestamp of the last access. Return value \Drupal\user\UserInterface The called user entity. Overrides UserInterface::setLastAccessTime File core/modules/user/src/Entity/User.php, line 251 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function setLastAccessTime($timestamp) { $this->get('access')->value = $ti

User::setExistingPassword

public User::setExistingPassword($password) Sets the existing plain text password. Required for validation when changing the password, name or email fields. Parameters string $password: The existing plain text password of the user. Return value $this Overrides UserInterface::setExistingPassword File core/modules/user/src/Entity/User.php, line 390 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function setExistingPassword($password) { $this->ge

User::setEmail

public User::setEmail($mail) Sets the email address of the user. Parameters string $mail: The new email address of the user. Return value \Drupal\user\UserInterface The called user entity. Overrides UserInterface::setEmail File core/modules/user/src/Entity/User.php, line 229 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function setEmail($mail) { $this->get('mail')->value = $mail; return $this; }

User::removeRole

public User::removeRole($rid) Remove a role from a user. Parameters string $rid: The role ID to remove. Overrides UserInterface::removeRole File core/modules/user/src/Entity/User.php, line 188 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function removeRole($rid) { $this->set('roles', array_diff($this->getRoles(TRUE), array($rid))); }