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

Add route to retrieve users assigned to a workspace with UI #4058

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

marrobi
Copy link
Member

@marrobi marrobi commented Aug 6, 2024

This pull request adds a new route to the workspaces_shared_router that allows users to retrieve the list of users assigned to a workspace. The route is /api/workspaces/{workspace_id}/users/.

The implementation uses the MS Graph API to retrieve the roles from the Enterprise Application. The API call GET /servicePrincipals(appId='{appId}')/appRoleAssignedTo is used to fetch the app roles assigned to the user.

The response of the API includes the name, email, and app roles of each user. The user interface also includes a new section called "Users" in the left-hand menu under Airlock. This section displays the list of users with their name, email, and role(s).

image

Also updated and refactored some of the repitition in the aad tests.

Fixes #4049

@marrobi
Copy link
Member Author

marrobi commented Aug 6, 2024

@jonnyry - or anyone else, if you fancy giving this a test, would welcome feedback. :)

Copy link

github-actions bot commented Aug 6, 2024

Unit Test Results

596 tests   594 ✅  7s ⏱️
  1 suites    2 💤
  1 files      0 ❌

Results for commit f4af0f9.

♻️ This comment has been updated with latest results.

@jjgriff93
Copy link
Collaborator

jjgriff93 commented Aug 6, 2024

I did the designs a while ago where users in a workspace were shown using an avatar group on the workspace nav bar (design here) and also on the workspace card (here). Maybe not something you want to look at in this PR but could be a good way to display this

name: string;
email: string;
role: string;
roles: string[];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

role and roles seems confusing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So for the grouped layout the user needs to appear once for each role in roles. Maybe I could remove roles at this point, but was thinking of doing something like this:

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can i resolve this?

@marrobi marrobi marked this pull request as ready for review August 6, 2024 15:24
@tim-allen-ck tim-allen-ck changed the title Add route to retrieve users assigned to a workspace Add route to retrieve users assigned to a workspace with UI Sep 5, 2024
Copy link
Collaborator

@tim-allen-ck tim-allen-ck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tim-allen-ck
Copy link
Collaborator

/test-extended

Copy link

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/10829416378 (with refid 9cc2c115)

(in response to this comment from @tim-allen-ck)

@tim-allen-ck
Copy link
Collaborator

/test-extended

Copy link

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/11068239761 (with refid 9cc2c115)

(in response to this comment from @tim-allen-ck)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

View users who are assigned roles within a workspace
3 participants