mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-04 16:11:11 -04:00
Change the format of the user_permissions data that gets sent
The endpoint for setting permissions in api will now be used for both user permissions and a user's folder permissions, so this changes the format of the data we pass through.
This commit is contained in:
@@ -164,7 +164,10 @@ class UserApiClient(NotifyAdminAPIClient):
|
||||
@cache.delete('user-{user_id}')
|
||||
def set_user_permissions(self, user_id, service_id, permissions):
|
||||
# permissions passed in are the combined admin roles, not db permissions
|
||||
data = [{'permission': x} for x in translate_permissions_from_admin_roles_to_db(permissions)]
|
||||
data = {
|
||||
'permissions': [{'permission': x} for x in translate_permissions_from_admin_roles_to_db(permissions)]
|
||||
}
|
||||
|
||||
endpoint = '/user/{}/service/{}/permission'.format(user_id, service_id)
|
||||
self.post(endpoint, data=data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user