diff --git a/app/api/server/v1/teams.ts b/app/api/server/v1/teams.ts index 1c6dca4c94e29..30c51f5dce7f4 100644 --- a/app/api/server/v1/teams.ts +++ b/app/api/server/v1/teams.ts @@ -175,7 +175,7 @@ API.v1.addRoute('teams.listRoomsOfUser', { authRequired: true }, { const allowPrivateTeam = hasPermission(this.userId, 'view-all-teams', team.roomId); - if (!hasPermission(this.userId, 'view-all-team-channels', team.roomId)) { + if (!(this.userId === userId || hasPermission(this.userId, 'view-all-team-channels', team.roomId))) { return API.v1.unauthorized(); }