Skip to content

Commit

Permalink
fixes #12726 (#12727)
Browse files Browse the repository at this point in the history
[FIX] API users.info returns caller rooms and not requested user ones
  • Loading branch information
piotrkochan authored and rodrigok committed Dec 5, 2018
1 parent 973d7ce commit 3ef5dd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rocketchat-api/server/v1/users.js
Expand Up @@ -130,7 +130,7 @@ RocketChat.API.v1.addRoute('users.info', { authRequired: true }, {

user = result[0];
if (fields.userRooms === 1 && RocketChat.authz.hasPermission(this.userId, 'view-other-user-channels')) {
user.rooms = RocketChat.models.Subscriptions.findByUserId(this.userId, {
user.rooms = RocketChat.models.Subscriptions.findByUserId(user._id, {
fields: {
rid: 1,
name: 1,
Expand Down

0 comments on commit 3ef5dd6

Please sign in to comment.