From b2886eae2df32ee400d5885f35074614fc3db505 Mon Sep 17 00:00:00 2001 From: shayanaijaz Date: Fri, 8 Dec 2023 10:55:33 -0600 Subject: [PATCH] small fix when transferring ownership --- .../workspace_operations/shared_workspace_operations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/portal/apps/projects/workspace_operations/shared_workspace_operations.py b/server/portal/apps/projects/workspace_operations/shared_workspace_operations.py index 081a6059a..db43a6574 100644 --- a/server/portal/apps/projects/workspace_operations/shared_workspace_operations.py +++ b/server/portal/apps/projects/workspace_operations/shared_workspace_operations.py @@ -227,10 +227,12 @@ def transfer_ownership(client, workspace_id: str, new_owner: str, old_owner: str """ service_client = service_account() system_id = f"{settings.PORTAL_PROJECTS_SYSTEM_PREFIX}.{workspace_id}" + + # Add permissions for current owner to prevent removal from project after transferring ownership set_workspace_acls(service_client, settings.PORTAL_PROJECTS_ROOT_SYSTEM_NAME, workspace_id, - new_owner, + old_owner, "add", "writer")