Jorricks commented on a change in pull request #16634:
URL: https://github.com/apache/airflow/pull/16634#discussion_r713391890
##########
File path: airflow/www/security.py
##########
@@ -520,6 +520,17 @@ def _has_perm(self, action_name, resource_name):
self._get_and_cache_perms()
return (action_name, resource_name) in self.perms
+ def has_all_dags_edit_access(self):
+ """
+ Has all the dag access in any of the 3 cases:
+ 1. Role needs to be in (Admin, Viewer, User, Op).
+ 2. Has can_read action on dags resource.
+ 3. Has can_edit action on dags resource.
+ """
+ return self._has_role(['Admin', 'Op', 'User']) or self._has_perm(
Review comment:
Alright. Pushing an update that removes this unnecessary helper function.
I originally implemented it for performance reasons, as many of these
helpers seem to be, but I agree that the performance improvement is negligible
and not worth the extra maintenance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]