airflow/security/permissions.py
RESOURCE_PERMISSION_VIEW = "Permission Views"  
RESOURCE_POOL = "Pools"
RESOURCE_PLUGIN = "Plugins"
RESOURCE_ROLE = "Roles"
RESOURCE_SLA_MISS = "SLA Misses"
RESOURCE_TASK_INSTANCE = "Task Instances"
RESOURCE_TASK_LOG = "Task Logs"
RESOURCE_TASK_RESCHEDULE = "Task Reschedules"
RESOURCE_USER = "Users"
RESOURCE_USER_STATS_CHART = "User Stats Chart"
RESOURCE_VARIABLE = "Variables"
RESOURCE_VIEW_MENU = "View Menus"
RESOURCE_WEBSITE = "Website"
RESOURCE_XCOM = "XComs"
ACTION_CAN_CREATE = "can_create"
ACTION_CAN_READ = "can_read"
ACTION_CAN_EDIT = "can_edit"
ACTION_CAN_DELETE = "can_delete"
ACTION_CAN_ACCESS_MENU = "menu_access"
DEPRECATED_ACTION_CAN_DAG_READ = "can_dag_read"
DEPRECATED_ACTION_CAN_DAG_EDIT = "can_dag_edit"
DAG_PERMS = {ACTION_CAN_READ, ACTION_CAN_EDIT}
def resource_name_for_dag(dag_id):
    """Returns the resource name for a DAG id."""
    if dag_id == RESOURCE_DAG:
        return dag_id
    if dag_id.startswith(RESOURCE_DAG_PREFIX):
        return dag_id
    return f"{RESOURCE_DAG_PREFIX}{dag_id}"