Search for hasRole

  1. Search 7.x for hasRole
  2. Search 9.5.x for hasRole
  3. Search 8.9.x for hasRole
  4. Search 11.x for hasRole
  5. Other projects
Title Object type File name Summary
AccountProxy::hasRole function core/lib/Drupal/Core/Session/AccountProxy.php Whether a user has a certain role.
AccountProxyTest::testHasRole function core/tests/Drupal/Tests/Core/Session/AccountProxyTest.php @covers ::hasRole
User::hasRole function core/modules/user/src/Entity/User.php Whether a user has a certain role.
UserInterface::hasRole function core/modules/user/src/UserInterface.php Whether a user has a certain role.
UserSession::hasRole function core/lib/Drupal/Core/Session/UserSession.php Whether a user has a certain role.
UserSessionTest::testHasRole function core/tests/Drupal/Tests/Core/Session/UserSessionTest.php Tests the hasRole method.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.