Skip to content

Commit

Permalink
Add possibility to create user in the Remote User mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz Wyszomirski committed Jan 25, 2022
1 parent 623163f commit f295bfb
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions airflow/www/views.py
Expand Up @@ -4920,3 +4920,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 f295bfb

Please sign in to comment.