def is_any_allowed(self, roles, operation, resource, **assertion_kwargs):
        is_allowed = None  # no matching rules
        for i, role in enumerate(roles):
            # if access not yet allowed and all remaining roles could only deny access, short-circuit and return False
            if not is_allowed and self._roles_are_deny_only(roles[i:]):
                return False

            check_allowed = not is_allowed  # if another role gave access, don't bother checking if this one is allowed
            is_current_allowed = self.is_allowed(
                role, operation, resource, check_allowed=check_allowed, **assertion_kwargs)
            if is_current_allowed is False:
                return False  # denied by rule
            elif is_current_allowed is True:
                is_allowed = True
        return is_allowed
Check the permission with many roles.
dataset/ETHPy150Open tonyseek/simple-rbac/rbac/acl.py/Registry.is_any_allowed