public function UserBCDecorator::hasRole

Whether a user has a certain role.

Parameters

string $rid: The role ID to check.

Return value

bool Returns TRUE if the user has the role, otherwise FALSE.

Overrides UserInterface::hasRole

File

drupal/core/modules/user/lib/Drupal/user/UserBCDecorator.php, line 61
Contains \Drupal\user\UserBCDecorator.

Class

UserBCDecorator
Defines the user specific entity BC decorator.

Namespace

Drupal\user

Code

public function hasRole($rid) {
  return $this
    ->getBCEntity()
    ->hasRole($rid);
}