-
- Downloads
Allow group managers to view all people (#40619)
Fixes #40328 [Our documentation](https://www.metabase.com/docs/latest/people-and-groups/managing#group-managers) states that: > Group managers can: > > - View all people in the Admin settings > People tab. This fixes enforcement to be aligned with the documentation. This behavior makes sense, because as the docs also state, Group Managers should be allowed to *add* people to the group they manage, which they can only do if they can see those people! Initially, I also removed a faulty test, which was described as: ``` ;; Non-segmented users are allowed to ask for a list of all of the users in the Metabase instance. Pulse email lists ;; are an example usage of this. Segmented users should not have that ability. Instead they should only see ;; themselves. This test checks that GET /api/user for a segmented user only returns themselves ``` but actually failed to test this in a relevant way (because it was testing the `GET /api/user` endpoint rather than the `GET /api/user/recipients` endpoint). The test had continued to pass only because the user was the only member of the group they managed. I initially thought this behavior wasn't desired, but as it turns out, it *is* in fact documented behavior to disallow sandboxed users from seeing any email suggestions. Investigating, I found that a bug was allowing sandboxed users to see all users on the `/api/user/recipients` endpoint if the user-visibility setting was set to `:all`. Thus, the second commit fixes the bug and re-adds the (fixed) test. A sandboxed user now only sees their own user when hitting `/api/user/recipients`.
Showing
- enterprise/backend/test/metabase_enterprise/sandbox/api/user_test.clj 36 additions, 27 deletions...ackend/test/metabase_enterprise/sandbox/api/user_test.clj
- src/metabase/api/user.clj 35 additions, 42 deletionssrc/metabase/api/user.clj
- test/metabase/api/user_test.clj 13 additions, 15 deletionstest/metabase/api/user_test.clj
Loading
Please register or sign in to comment