airflow/www/security.py
self, perms: Optional[Sequence[Tuple[str, str]]] = None, dag_id: Optional[str] = None
    ) -> bool:
        """Checks that the logged in user has the specified permissions."""
        if not perms:
            return True
        for perm in perms:
            if perm in (
                (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG),
                (permissions.ACTION_CAN_EDIT, permissions.RESOURCE_DAG),
            ):
                can_access_all_dags = self.has_access(*perm)
                if can_access_all_dags:
                    continue
                action = perm[0]
                if self.can_access_some_dags(action, dag_id):
                    continue
                return False
            elif not self.has_access(*perm):
                return False
        return True
class ApplessAirflowSecurityManager(AirflowSecurityManager):
    """Security Manager that doesn't need the whole flask app"""
    def __init__(self, session=None):  
        self.session = session
    @property
    def get_session(self):
        return self.session