code: def sync_perm(args):
      """Update permissions for existing roles and DAGs."""
      from airflow.providers.fab.auth_manager.cli_commands.utils import (
          get_application_builder,
      )
  
      with get_application_builder() as appbuilder:
          print("Updating actions and resources for all existing roles")
          # Add missing permissions for all the Base Views _before_ syncing/creating roles
          appbuilder.add_permissions(update_perms=True)
          appbuilder.sm.sync_roles()
          if args.include_dags:
              print("Updating permission on all DAG views")
              appbuilder.sm.create_dag_specific_permissions()
  
imports: from __future__ import annotations
  from airflow.utils import cli
  from airflow.utils.providers_configuration_loader import providers_configuration_loaded
label_desc: Use image node_id 1 for calling a global function with example usage: sync_perm(args) without return types