src/flask_allows/allows.py
def fulfill(self, requirements, identity=None):
        """
        Checks that the provided or current identity meets each requirement
        passed to this method.

        This method takes into account both additional and overridden
        requirements, with overridden requirements taking precedence::

            allows.additional.push(Additional(Has('foo')))
            allows.overrides.push(Override(Has('foo')))

            allows.fulfill([], user_without_foo)  # return True

        :param requirements: The requirements to check the identity against.
        :param identity: Optional. Identity to use in place of the current
            identity.
        """
        identity = identity or self._identity_loader()

        if self.additional.current:
            all_requirements = chain(iter(self.additional.current), requirements)
        else:
            all_requirements = iter(requirements)

        if self.overrides.current is not None:
            all_requirements = (
                r for r in all_requirements if r not in self.overrides.current
            )

        return all(_call_requirement(r, identity, request) for r in all_requirements)
def fulfill(self, requirements, identity=None):
        identity = identity or self._identity_loader()

        if self.additional.current:
            all_requirements = chain(iter(self.additional.current), requirements)
        else:
            all_requirements = iter(requirements)

        if self.overrides.current is not None:
            all_requirements = (
                r for r in all_requirements if r not in self.overrides.current
            )

        return all(_call_requirement(r, identity, request) for r in all_requirements)
def fulfill ( self , requirements , identity = None ) : identity = identity or self . _identity_loader ( ) if self . additional . current : all_requirements = chain ( iter ( self . additional . current ) , requirements ) else : all_requirements = iter ( requirements ) if self . overrides . current is not None : all_requirements = ( r for r in all_requirements if r not in self . overrides . current ) return all ( _call_requirement ( r , identity , request ) for r in all_requirements )
Checks that the provided or current identity meets each requirement
        passed to this method.

        This method takes into account both additional and overridden
        requirements, with overridden requirements taking precedence::

            allows.additional.push(Additional(Has('foo')))
            allows.overrides.push(Override(Has('foo')))

            allows.fulfill([], user_without_foo)  # return True

        :param requirements: The requirements to check the identity against.
        :param identity: Optional. Identity to use in place of the current
            identity.
Checks that the provided or current identity meets each requirement passed to this method .