Skip to content

feat: Normal user list - #7887

Merged
rhafer merged 10 commits into
masterfrom
normal_user_list
Dec 7, 2023
Merged

rhafer merged 10 commits into
masterfrom
normal_user_list

Conversation

@jvillafanez

Copy link
Copy Markdown
Member

Description

Allow regular users to list other users.

People with account management permissions (such as admins) can list users as they have been until now. This PR won't affect them in any way.

Regular users (without account management permission) can list users with the following restrictions:

  • Only "id", "displayName" and "mail" attributes will be shown per user.
  • "$search" option MUST be present in the query, with at least 3 characters
  • "$filter", "$apply", "$expand" and "$compute" options aren't allowed

Related Issue

#7782

Motivation and Context

How Has This Been Tested?

Manually tested.
Unit tests have been adjusted because some of them where failing due to the user not having enough permissions

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs

update-docs Bot commented Dec 5, 2023

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@AlexAndBear AlexAndBear left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please add a test to validate that only the minimal set of id,displayName and mail is present if the regular user is requesting the users endpoint ?

@rhafer

rhafer commented Dec 6, 2023

Copy link
Copy Markdown
Contributor

I took over here as @jvillafanez can't currently work it.

@rhafer

rhafer commented Dec 6, 2023

Copy link
Copy Markdown
Contributor

Could you please add a test to validate that only the minimal set of id,displayName and mail is present if the regular user is requesting the users endpoint ?

@janackermann done. Please re-review

@rhafer
rhafer requested a review from AlexAndBear December 6, 2023 10:34

@AlexAndBear AlexAndBear left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💪

@micbar micbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One change request, rest looks fine.

Comment thread services/graph/pkg/service/v0/users.go Resolved
@micbar micbar mentioned this pull request Dec 6, 2023
22 tasks done
@micbar

micbar commented Dec 6, 2023

Copy link
Copy Markdown
Contributor

Some getUser tests are failing.

@rhafer

rhafer commented Dec 6, 2023

Copy link
Copy Markdown
Contributor

Some getUser tests are failing.

Should be fixed now. I took the chance to also add the group search here now as well.

@rhafer
rhafer requested a review from micbar December 6, 2023 13:10
@sonarqubecloud

sonarqubecloud Bot commented Dec 6, 2023

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

78.8% 78.8% Coverage
11.8% 11.8% Duplication

@v-scharf

Copy link
Copy Markdown
Contributor

Only "id", "displayName" and "mail" attributes will be shown per user.

we can bug where we can get full info about user #5125

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.

5 participants