Skip to content

Commit 0136df5

Browse files
[IMPROVE] add permission check when adding a channel to a team (RocketChat#21689)
Co-authored-by: Diego Sampaio <chinello@gmail.com>
1 parent 88804b2 commit 0136df5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

server/services/team/service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ export class TeamService extends ServiceClass implements ITeamService {
324324
throw new Error('room-already-on-team');
325325
}
326326

327+
if (room.u?._id !== uid) {
328+
throw new Error('invalid-user');
329+
}
330+
327331
room.teamId = teamId;
328332
}
329333

0 commit comments

Comments
 (0)