class RequiresAll(Permission):

    def allows(self, identity):
        if not has_all(self.needs, identity.provides):
            return False
if self.excludes and self.excludes.intersection(identity.provides):
    return False
return True

def has_all(needed=None, provided=None):
    if needed is None:
        return True
if provided is None:
    provided = set()
Combining RoleNeed's with Flask Principal