mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-04 19:29:49 -06:00
graph/users: Return 'userType' for request from unprivileged users
This commit is contained in:
committed by
Ralf Haferkamp
parent
d0289694e4
commit
20870380b1
@@ -266,7 +266,12 @@ func (g Graph) GetUsers(w http.ResponseWriter, r *http.Request) {
|
||||
if !ctxHasFullPerms {
|
||||
finalUsers := make([]*libregraph.User, len(users))
|
||||
for i, u := range users {
|
||||
finalUsers[i] = &libregraph.User{Id: u.Id, DisplayName: u.DisplayName, Mail: u.Mail}
|
||||
finalUsers[i] = &libregraph.User{
|
||||
Id: u.Id,
|
||||
DisplayName: u.DisplayName,
|
||||
Mail: u.Mail,
|
||||
UserType: u.UserType,
|
||||
}
|
||||
}
|
||||
users = finalUsers
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ var _ = Describe("Users", func() {
|
||||
userMap, err := res.Value[0].ToMap()
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
for k, _ := range userMap {
|
||||
Expect(k).Should(BeElementOf([]string{"mail", "displayName", "id"}))
|
||||
Expect(k).Should(BeElementOf([]string{"mail", "displayName", "id", "userType"}))
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user