**Reproduce on main:**
- Run a DAG
- Rename the DAG
- Wait for dag file processor to remove the deleted DAG and add the new one. (Old Dag should not appear on the home page anymore)
- Go to the Browse DAGRUN page.
- Click on a DagRun of the deleted DAG, as if you want to see the 'details/grid' of that old dag run

More info and screenshots here:
https://github.com/notifications#discussioncomment-6898570

![image](https://github.com/apache/airflow/assets/14861206/7af81643-6278-4d90-a20f-6aa7b259ce59)



"""
    Add `.can_edit`, `.can_trigger`, and `.can_delete` properties to DAG based on current user's permissions.
    Located in `views.py` rather than the DAG model to keep permissions logic out of the Airflow core.
    """
    if "dag" not in context:
        return
    dag = context["dag"]
    can_create_dag_run = get_auth_manager().is_authorized_dag(
        method="POST", access_entity=DagAccessEntity.RUN
    )
    dag.can_edit = get_auth_manager().is_authorized_dag(method="PUT", details=DagDetails(id=dag.dag_id))
    dag.can_trigger = dag.can_edit and can_create_dag_run
    dag.can_delete = get_auth_manager().is_authorized_dag(method="DELETE", details=DagDetails(id=dag.dag_id))
    context["dag"] = dag
def restrict_to_dev(f):
    def wrapper(*args, **kwargs):
        if not os.environ.get("AIRFLOW_ENV", None) == "development":
            logging.error(
                "You can only access this view in development mode. Set AIRFLOW_ENV=development to view it."
            )
            return abort(404)
        return f(*args, **kwargs)
    return wrapper
class DevView(BaseView):