public function PeopleAccess::access in Open Social 8.4
Same name and namespace in other branches
- 8.9 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
- 8 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
- 8.2 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
- 8.3 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
- 8.5 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
- 8.6 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
- 8.7 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
- 8.8 modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
- 10.3.x modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
- 10.0.x modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
- 10.1.x modules/social_features/social_user/src/Plugin/views/access/PeopleAccess.php \Drupal\social_user\Plugin\views\access\PeopleAccess::access()
- 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\accessCode
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;
}