mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Send updated user folder permissions to the API
Integrates the folder permissions form with the updated API endpoint to store changes in the user folders. Since user folder permissions are returned in the full list of template folders for the service we need to invalidate the cache key for it each time we update user permissions.
This commit is contained in:
@@ -87,6 +87,10 @@ def edit_user_permissions(service_id, user_id):
|
||||
form = PermissionsForm.from_user(
|
||||
user,
|
||||
service_id,
|
||||
folder_permissions=[
|
||||
f['id'] for f in current_service.all_template_folders
|
||||
if user_id in f.get('users_with_permission', [])
|
||||
],
|
||||
all_template_folders=current_service.all_template_folders
|
||||
)
|
||||
|
||||
@@ -94,6 +98,10 @@ def edit_user_permissions(service_id, user_id):
|
||||
user_api_client.set_user_permissions(
|
||||
user_id, service_id,
|
||||
permissions=form.permissions,
|
||||
folder_permissions=(
|
||||
form.folder_permissions.data
|
||||
if current_service.has_permission('edit_folder_permissions') else None
|
||||
),
|
||||
)
|
||||
if service_has_email_auth:
|
||||
user_api_client.update_user_attribute(user_id, auth_type=form.login_authentication.data)
|
||||
|
||||
Reference in New Issue
Block a user