Skip to content

Commit

Permalink
[AIRFLOW-3947] Flash msg for no DAG-level access error (apache#4767)
Browse files Browse the repository at this point in the history
* [AIRFLOW-3947] Flash msg for no DAG-level access error

It will show and remind user when a user clicks on a DAG that
he/she doesn't have can_dag_read or can_dag_edit permissions.

* Change the flash msg contents
  • Loading branch information
XD-DENG authored and andriisoldatenko committed Jul 26, 2019
1 parent f7a4047 commit 7535f44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/www/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import functools
import pendulum
from io import BytesIO as IO
from flask import after_this_request, redirect, request, url_for, g
from flask import after_this_request, flash, redirect, request, url_for, g
from airflow.models.log import Log
from airflow.utils.db import create_session

Expand Down Expand Up @@ -120,6 +120,7 @@ def wrapper(self, *args, **kwargs):
dag_id)))):
return f(self, *args, **kwargs)
else:
flash("Access is Denied", "danger")
return redirect(url_for(self.appbuilder.sm.auth_view.
__class__.__name__ + ".login"))
return wrapper
Expand Down

0 comments on commit 7535f44

Please sign in to comment.