Complete the code to define the Airflow role that allows viewing DAGs but not editing them.
role = BaseRole(name='Viewer', permissions=[1])
The 'Viewer' role should have 'can_read' permission to view DAGs without editing rights.
Complete the code to assign the 'Admin' role to a user in Airflow.
user.roles.append([1])Assigning the 'Admin' role gives the user full access to manage pipelines.
Fix the error in the code to restrict DAG access to only authorized users.
dag = DAG('sensitive_data', access_control=[1])
Access control must be a dictionary mapping roles to permission sets, like {'Admin': {'can_read', 'can_edit'}}.
Fill both blanks to create a policy that allows only Admins to trigger DAG runs and view logs.
access_policy = [1]: {'can_trigger_dag', [2]
The policy grants 'Admin' role permissions to 'can_trigger_dag' and 'can_view_logs'.
Fill all three blanks to define a secure DAG with restricted access and schedule.
dag = DAG('[1]', schedule_interval=[2], access_control=[3])
The DAG named 'secure_pipeline' runs daily and restricts access to Admins with read and edit permissions.