def sync_perm_for_dag(self, dag_id, access_control=None):
for dag_perm in self.DAG_PERMS:<EOL><INDENT>perm_on_dag = self.find_permission_view_menu(dag_perm, dag_id)<EOL>if perm_on_dag is None:<EOL><INDENT>self.add_permission_view_menu(dag_perm, dag_id)<EOL><DEDENT><DEDENT>if access_control:<EOL><INDENT>self._sync_dag_view_permissions(dag_id, access_control)<EOL><DEDENT>
Sync permissions for given dag id. The dag id surely exists in our dag bag
as only / refresh button or cli.sync_perm will call this function

:param dag_id: the ID of the DAG whose permissions should be updated
:type dag_id: string
:param access_control: a dict where each key is a rolename and
    each value is a set() of permission names (e.g.,
    {'can_dag_read'}
:type access_control: dict
:return: