Skip to content
Snippets Groups Projects
Commit 1c48009c authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Fixes #2363

parent fa5ee2f3
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,9 @@ Meteor.methods
room = RocketChat.models.Rooms.findOneById rid
unless room
throw new Meteor.Error 'invalid-room', '[methods] unarchiveRoom -> Invalid room'
if room.u? and room.u._id is Meteor.userId() or RocketChat.authz.hasRole(Meteor.userId(), 'admin')
RocketChat.models.Rooms.archiveById rid
......
......@@ -5,6 +5,9 @@ Meteor.methods
room = RocketChat.models.Rooms.findOneById rid
unless room
throw new Meteor.Error 'invalid-room', '[methods] unarchiveRoom -> Invalid room'
if room.u? and room.u._id is Meteor.userId() or RocketChat.authz.hasRole(Meteor.userId(), 'admin')
RocketChat.models.Rooms.unarchiveById rid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment