Returns True if the user is allowed by the ACL
494932
def is_user_accepted_by_access_control(self, user_info):
        
        if self.get_access_control_method() is None:
            return True
        elif not user_info:
            return False
        elif self.get_access_control_method() == "username":
            return user_info["username"] in self.get_access_control_list()
        elif self.get_access_control_method() == "email":
            return user_info["email"] in self.get_access_control_list()
        elif self.get_access_control_method() == "binding":
            return set(user_info["bindings"].keys()).intersection(set(self.get_access_control_list()))
        return False
1209190
def check_permissions(self, request):
        """"""

        if not self.predicates:
            return True

        # All registered authentication predicates must return True
        return all(
            predicate(request, *self.predicates_params[i])
            for i, predicate in enumerate(self.predicates)
        )
1046326
def permitted_to! (privilege, object_or_sym = nil, options = {})
      authorization_engine.permit!(privilege, options_for_permit(object_or_sym, options, true))
    end
384072
def get_acl_on(request):
    
    acl_on = settings.ACL_ON
    if settings.LOCKDOWN and hasattr(request, 'user'):
        # ACL is always disabled for superusers
        if request.user.is_superuser:
            acl_on = False
    return acl_on
469000
public boolean hasPermission(AccessControlList acl, String[] permission, Identity user)
   {

      String userId = user.getUserId();

      if (userId.equals(IdentityConstants.SYSTEM))
      {
         // SYSTEM has permission everywhere
         return true;
      }
      else if (userId.equals(acl.getOwner()))
      {
         // Current user is owner of node so has all privileges
         return true;
      }
      else if (userId.equals(IdentityConstants.ANONIM))
      {
         List<String> anyPermissions = acl.getPermissions(IdentityConstants.ANY);

         if (anyPermissions.size() < permission.length)
            return false;

         for (int i = 0; i < permission.length; i++)
         {
            if (!anyPermissions.contains(permission[i]))
               return false;
         }

         return true;
      }
      else
      {

         if (acl.getPermissionsSize() > 0 && permission.length > 0)
         {
            // check permission to perform all of the listed actions
            for (int i = 0; i < permission.length; i++)
            {
               // check specific actions
               if (!isPermissionMatch(acl.getPermissionsList(), permission[i], user))
                  return false;
            }
            return true;
         }
         return false;

      }
   }
563045
def allows(self, user, permission, obj=_nothing):
        
        rule = self._get_rule(obj)

        if not isinstance(permission, basestring):
            return all(
                self._use_rule(rule, user, perm, obj)
                for perm in permission
            )

        return self._use_rule(rule, user, permission, obj)
955706
async def grant(self, acl='login'):
        
        if await self.controller.grant(self.username, acl):
            self._user_info.access = acl
192252
public boolean isForbidden() {
        if (authorities.size() == 0) {
            return false; // If no restrictions, return false
        }

        boolean result = true;

        for (Authority priv : authorities) {
            result = !SecurityUtil.isGranted(priv.name);

            if (requiresAll == result) {
                break;
            }
        }

        return result;
    }
489807
function allowed(packet) {
    if (!packet) return false;

    if (uv.position === 'inactive' || (!uv.received(packet.id) && ordered)) {
      queue.push(packet);
      return false;
    }

    return true;
  }
82508
public function permitted($options = []) : bool {
		// authorized
		if (\User::authorized()) {
			// see if controller is for authorized
			if (empty($this->acl['authorized'])) return false;
			// permissions
			if (!empty($this->acl['permission'])) {
				// determine action
				switch ($this->method_code) {
					case 'Edit': $action = 'Record_View'; break;
					case 'Index': $action = 'List_View'; break;
					case 'Activate': $action = 'Activate_Data'; break;
					// if we need to alter menu name
					case 'JsonMenuName':
					case 'JsonMenuName2':
					case 'JsonMenuName3':
					case 'JsonMenuName4':
					case 'JsonMenuName5':
						foreach (['Edit' => 'Record_View', 'Index' => 'List_View', 'Activate' => 'Activate_Data'] as $k => $v) {
							if ($this->can($v, $k)) {
								return true;
							}
						}
						return false;
						break;
				}
				return $this->can($action);
			}
		} else {
			// we need to redirect to login controller if not authorized
			if (($options['redirect'] ?? false) && !empty($this->acl['authorized']) && empty($this->acl['public']) && !\Application::get('flag.global.__skip_session')) {
				\Request::redirect(\Object\ACL\Resources::getStatic('authorization', 'login', 'url'));
			}
			// public permission
			if (empty($this->acl['public'])) {
				return false;
			}
		}
		return true;
	}
1343271
def can(self):
        """"""
        return str(current_user.get_id()) == str(self.community.id_user) or \
            DynamicPermission(ActionNeed('admin-access')).can()
915969
private boolean hasPermissionToSeeToken() {
        // Administrators can do whatever they want
        if (SHOW_LEGACY_TOKEN_TO_ADMINS && Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
            return true;
        }
        
        User current = User.current();
        if (current == null) { // Anonymous
            return false;
        }
        
        // SYSTEM user is always eligible to see tokens
        if (Jenkins.getAuthentication() == ACL.SYSTEM) {
            return true;
        }
        
        return User.idStrategy().equals(user.getId(), current.getId());
    }
898061
private void checkACL(String path, int perm) throws KeeperException.NoAuthException {
        DataAndVersion node = _data.get(path);
        if (node == null) {
            return;
        }
        List<ACL> acl = node.getAcl();
        if (acl == null || acl.size() == 0) {
            return;
        }
        for (Id authId : _ids) {
            if (authId.getScheme().equals("super")) {
                return;
            }
        }
        for (ACL a : acl) {
            Id id = a.getId();
            if ((a.getPerms() & perm) != 0) {
                if (id.getScheme().equals("world") && id.getId().equals("anyone")) {
                    return;
                }
                for (Id authId : _ids) {
                    if (authId.getScheme().equals(id.getScheme()) && authId.getId().equals(id.getId())) {
                        return;
                    }
                }
            }
        }
        throw new KeeperException.NoAuthException();
    }
154606
private function __canAccessAlerts()
    {
        if ($this->Page instanceof AdministrationPage && self::isLoggedIn() && Symphony::Author()->isDeveloper()) {
            return true;
        }

        return false;
    }
1112026
def check_can_approve(self, request, application, roles):
        
        try:
            authorised_persons = self.get_authorised_persons(application)
            authorised_persons.get(pk=request.user.pk)
            return True
        except Person.DoesNotExist:
            return False
1016086
async def permits(self, identity, permission, context=None):
        
        # pylint: disable=unused-argument
        user = self.user_map.get(identity)
        if not user:
            return False
        return permission in user.permissions
886459
def space_acl(args):
    ''' '''
    r = fapi.get_workspace_acl(args.project, args.workspace)
    fapi._check_response_code(r, 200)
    result = dict()
    for user, info in sorted(r.json()['acl'].items()):
        result[user] = info['accessLevel']
    return result