def test_get_accessible_dag_ids(self):
    role_name = 'MyRole1'
    permission_action = [permissions.ACTION_CAN_READ]
    dag_id = 'dag_id'
    username = 'ElUser'
    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)])
    dag_model = DagModel(dag_id=dag_id, fileloc='/tmp/dag_.py', schedule_interval='2 2 * * *')
    self.session.add(dag_model)
    self.session.commit()
    self.security_manager.sync_perm_for_dag(dag_id, access_control={role_name: permission_action})
    self.assertEqual(self.security_manager.get_accessible_dag_ids(user), {'dag_id'})
def test_get_accessible_dag_ids(self):
    role_name = 'MyRole1'
    permission_action = [permissions.ACTION_CAN_READ]
    dag_id = 'dag_id'
    username = 'ElUser'
    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)])
    dag_model = DagModel(dag_id=dag_id, fileloc='/tmp/dag_.py', schedule_interval='2 2 * * *')
    self.session.add(dag_model)
    self.session.commit()
    self.security_manager.sync_perm_for_dag(dag_id, access_control={role_name: permission_action})
    self.assertEqual(self.security_manager.get_accessible_dag_ids(user), {'dag_id'})