def test_all_dag_access_doesnt_give_non_dag_access(self):
    username = 'dag_access_user'
    role_name = 'dag_access_role'
    with self.app.app_context():
        user = fab_utils.create_user(self.app, username, role_name, permissions=[(permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG), (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG)])
        self.assertTrue(self.security_manager.has_access(permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG, user))
        self.assertFalse(self.security_manager.has_access(permissions.ACTION_CAN_READ, permissions.RESOURCE_TASK_INSTANCE, user))
def test_all_dag_access_doesnt_give_non_dag_access(self):
    username = 'dag_access_user'
    role_name = 'dag_access_role'
    with self.app.app_context():
        user = fab_utils.create_user(self.app, username, role_name, permissions=[(permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG), (permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG)])
        self.assertTrue(self.security_manager.has_access(permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG, user))
        self.assertFalse(self.security_manager.has_access(permissions.ACTION_CAN_READ, permissions.RESOURCE_TASK_INSTANCE, user))