Skip to content

airflow sync-perm command does not sync DAG level Access Control  #13376

@kaxil

Description

@kaxil

Apache Airflow version: 2.0.0

What happened:

Running sync_perm CLI command does not synchronize the permission granted through the DAG via access_control.

This is because of dag serialization. When dag serialization is enabled, the dagbag will exhibit a lazy loading behaviour.

How to reproduce it:

  1. Add access_control to a DAG where the new role has permission to see the DAG.
    access_control={
        "test": {'can_dag_read'}
    },
  1. Run airflow sync-perm.
  2. Log in as the new user and you will still not see any DAG.
  3. If you refresh the DAG, the new user will be able to DAG after they refresh their page

Expected behavior
When I run airflow sync-perm, I expect the role who has been granted read permission for the DAG to be able to see that DAG.

This is also an issue with 1.10.x with DAG Serialization enabled, so would be good to backport it too.

Metadata

Metadata

Assignees

Labels

kind:bugThis is a clearly a bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions