mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-15 09:34:25 -05:00
Set folder permissions when creating and accepting invites to services
Added a folder permissions form to the page to invite users to services. This only shows if the service has 'edit_folder_permissions' enabled, and all folder checkboxes are checked by default. This change means that InviteApiClient.create_invite now sends folder_permissions through to notifications_api (so invites get created with folder permissions). Started passing the folder_permissions through to notifications-api when accepting an invite. This changes UserApiClient.add_user_to_service to send folder_permissions to notifications_api so that new users get folder permissions when they are added to the service.
This commit is contained in:
@@ -12,7 +12,13 @@ class InviteApiClient(NotifyAdminAPIClient):
|
||||
|
||||
self.admin_url = app.config['ADMIN_BASE_URL']
|
||||
|
||||
def create_invite(self, invite_from_id, service_id, email_address, permissions, auth_type):
|
||||
def create_invite(self,
|
||||
invite_from_id,
|
||||
service_id,
|
||||
email_address,
|
||||
permissions,
|
||||
auth_type,
|
||||
folder_permissions):
|
||||
data = {
|
||||
'service': str(service_id),
|
||||
'email_address': email_address,
|
||||
@@ -20,6 +26,7 @@ class InviteApiClient(NotifyAdminAPIClient):
|
||||
'permissions': ','.join(sorted(translate_permissions_from_admin_roles_to_db(permissions))),
|
||||
'auth_type': auth_type,
|
||||
'invite_link_host': self.admin_url,
|
||||
'folder_permissions': folder_permissions,
|
||||
}
|
||||
data = _attach_current_user(data)
|
||||
resp = self.post(url='/service/{}/invite'.format(service_id), data=data)
|
||||
|
||||
Reference in New Issue
Block a user