Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify when deleting workspace A from Workspace GroupA, all role bindings are deleted to related to Workspace GroupA #370

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading