Skip to content

Commit

Permalink
Add possibility to create user in the Remote User mode (#19963)
Browse files Browse the repository at this point in the history
(cherry picked from commit cdd9ea6)
  • Loading branch information
Łukasz Wyszomirski authored and jedcunningham committed Feb 10, 2022
1 parent b1e3572 commit fc6b0b3
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions airflow/www/views.py
Expand Up @@ -4731,3 +4731,28 @@ class CustomUserOIDModelView(MultiResourceUserMixin, UserOIDModelView):

class CustomUserRemoteUserModelView(MultiResourceUserMixin, UserRemoteUserModelView):
"""Customize permission names for FAB's builtin UserRemoteUserModelView."""

_class_permission_name = permissions.RESOURCE_USER

class_permission_name_mapping = {
'userinfoedit': permissions.RESOURCE_MY_PROFILE,
'userinfo': permissions.RESOURCE_MY_PROFILE,
}

method_permission_name = {
'add': 'create',
'userinfo': 'read',
'download': 'read',
'show': 'read',
'list': 'read',
'edit': 'edit',
'userinfoedit': 'edit',
'delete': 'delete',
}

base_permissions = [
permissions.ACTION_CAN_CREATE,
permissions.ACTION_CAN_READ,
permissions.ACTION_CAN_EDIT,
permissions.ACTION_CAN_DELETE,
]

0 comments on commit fc6b0b3

Please sign in to comment.