Skip to content

Commit

Permalink
fix: when delete workspaceA from Workspace GroupA, all role bindings …
Browse files Browse the repository at this point in the history
…are deleted of Workspace GroupA

Signed-off-by: Youngjin Jo <[email protected]>
  • Loading branch information
yjinjo committed Sep 27, 2024
1 parent ba2ad93 commit 94a41e0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/spaceone/identity/service/workspace_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def _add_workspace_to_group(
def _remove_workspace_from_group(
self, workspace_id: str, old_workspace_group_id: str, domain_id: str
) -> None:
self._delete_role_bindings(old_workspace_group_id, domain_id)
self._delete_role_bindings(workspace_id, old_workspace_group_id, domain_id)

if old_workspace_group_id:
workspace_vo = self.workspace_mgr.get_workspace(
Expand Down Expand Up @@ -505,8 +505,11 @@ def _remove_workspace_from_group(
workspace_vo,
)

def _delete_role_bindings(self, existing_workspace_group_id: str, domain_id: str):
def _delete_role_bindings(
self, workspace_id: str, existing_workspace_group_id: str, domain_id: str
):
rb_vos = self.rb_mgr.filter_role_bindings(
workspace_id=workspace_id,
workspace_group_id=existing_workspace_group_id,
domain_id=domain_id,
)
Expand Down

0 comments on commit 94a41e0

Please sign in to comment.