Skip to content
Snippets Groups Projects
Commit 5dafc7fb authored by Michael Lee's avatar Michael Lee
Browse files

Merge branch 'userprotect' into lee5151

parents b6fd2c78 26ae3f89
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,12 @@ function userprotect_rule_load($name) {
* Implements hook_ENTITY_TYPE_access() for entity type "user".
*/
function userprotect_user_access(UserInterface $entity, $op, AccountInterface $account) {
// User Protect doesn't limit view access in any way, so bail out early to
// save time.
if (in_array($op, ['view', 'view label'])) {
return AccessResult::neutral();
}
// Check if the account has the permission "userprotect.bypass_all".
// If so, all protections rules should be ignored.
if (!$account->hasPermission('userprotect.bypass_all')) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment