1 user_role_layout_access.inc UserRoleLayoutAccess::checkAccess()

Checks for access based on the available context.

Return value

boolean: The result of the access check.

Overrides LayoutAccess::checkAccess

File

core/modules/layout/plugins/access/user_role_layout_access.inc, line 32
Plugin to provide access control based upon role membership.

Class

UserRoleLayoutAccess
@file Plugin to provide access control based upon role membership.

Code

function checkAccess() {
  $account = $this->contexts['user']->data;
  $roles = $account->roles;
  return count(array_intersect($this->settings['roles'], $roles)) > 0;
}