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 4, 2018
1 parent 54294dd commit 3dacacc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rocketchat-api/server/v1/users.js
Original file line number Diff line number Diff line change
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 3dacacc

Please sign in to comment.