Skip to content

Commit

Permalink
Merge pull request #347 from yjinjo/master
Browse files Browse the repository at this point in the history
Add user_name and state when get the WorkspaceGroup
  • Loading branch information
yjinjo authored Sep 7, 2024
2 parents 6b586ae + bc9314d commit 7c0434c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/spaceone/identity/service/workspace_group_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,23 @@ def get(
if role_type != "DOMAIN_ADMIN":
raise ERROR_PERMISSION_DENIED()

workspace_group_id = params.workspace_group_id
domain_id = params.domain_id

workspace_group_vo = self.workspace_group_mgr.get_workspace_group(
params.workspace_group_id, params.domain_id
workspace_group_id, domain_id
)

return WorkspaceGroupResponse(**workspace_group_vo.to_dict())
old_users, new_users = self.workspace_group_mgr.get_old_users_and_new_users(
workspace_group_vo.users, workspace_group_id, domain_id
)

workspace_group_user_ids: List[str] = old_users + new_users

workspace_group_dict = self.add_user_name_and_state_to_users(
workspace_group_user_ids, workspace_group_vo, domain_id
)
return WorkspaceGroupResponse(**workspace_group_dict)

@transaction(permission="identity:WorkspaceGroup.read", role_types=["DOMAIN_ADMIN"])
@append_query_filter(["workspace_group_id", "name", "domain_id"])
Expand Down

0 comments on commit 7c0434c

Please sign in to comment.