You are here

public function PeopleAccess::access in Open Social 8.4

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
  2. 8 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
  3. 8.2 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
  4. 8.3 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
  5. 8.5 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
  6. 8.6 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
  7. 8.7 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
  8. 8.8 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
  9. 10.3.x modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
  10. 10.0.x modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
  11. 10.1.x modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
  12. 10.2.x modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()

Determine if the current user has access or not.

Parameters

\Drupal\Core\Session\AccountInterface $account: The user who wants to access this view.

Return value

bool Returns whether the user has access to the view.

Overrides AccessPluginBase::access

File

modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php, line 32

Class

PeopleAccess
People page access plugin that provides access control based on some perms.

Namespace

Drupal\social_user\Plugin\views\access

Code

public function access(AccountInterface $account) {

  // Check if user has administer users or view user access.
  $administerUsers = $account
    ->hasPermission('administer users');
  $viewUsers = $account
    ->hasPermission('view users');
  return $administerUsers | $viewUsers;
}