Skip to content

Commit

Permalink
Don't add Website.can_read access to default roles. (#13923)
Browse files Browse the repository at this point in the history
related: #13856
(cherry picked from commit 70ce0d8)
  • Loading branch information
jhtimmins authored and kaxil committed Feb 4, 2021
1 parent 46ea507 commit f0aa930
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions airflow/www/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,14 +441,15 @@ def _merge_perm(self, permission_name, view_menu_name):

def add_homepage_access_to_custom_roles(self):
"""
Add Website.can_read access to all roles.
Add Website.can_read access to all custom roles.
:return: None.
"""
website_permission = self.add_permission_view_menu(
permissions.ACTION_CAN_READ, permissions.RESOURCE_WEBSITE
)
for role in self.get_all_roles():
custom_roles = [role for role in self.get_all_roles() if role.name not in EXISTING_ROLES]
for role in custom_roles:
self.add_permission_role(role, website_permission)

self.get_session.commit()
Expand Down

0 comments on commit f0aa930

Please sign in to comment.