Skip to content

Commit

Permalink
fix: add canView check to /api/v3/users/:uid
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Apr 12, 2024
1 parent 14f5774 commit 5bee324
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/api/users.js
Expand Up @@ -41,6 +41,10 @@ usersAPI.create = async function (caller, data) {
};

usersAPI.get = async (caller, { uid }) => {
const canView = await privileges.global.can('view:users', caller.uid);
if (!canView) {
throw new Error('[[error:no-privileges]]');
}
const userData = await user.getUserData(uid);
return await user.hidePrivateData(userData, caller.uid);
};
Expand Down

0 comments on commit 5bee324

Please sign in to comment.