Skip to content

Commit

Permalink
Add possibility to create users in LDAP mode (#22619)
Browse files Browse the repository at this point in the history
* Add possibility to create users in LDAP mode

GitOrigin-RevId: 4e4c0574cdd3689d22e2e7d03521cb82179e0909
  • Loading branch information
dx034 authored and Cloud Composer Team committed Sep 12, 2024
1 parent 88c859b commit 5ba903f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5318,6 +5318,31 @@ class CustomUserDBModelView(MultiResourceUserMixin, UserDBModelView):
class CustomUserLDAPModelView(MultiResourceUserMixin, UserLDAPModelView):
"""Customize permission names for FAB's builtin UserLDAPModelView."""

_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,
]


class CustomUserOAuthModelView(MultiResourceUserMixin, UserOAuthModelView):
"""Customize permission names for FAB's builtin UserOAuthModelView."""
Expand Down

0 comments on commit 5ba903f

Please sign in to comment.