The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/server/methods/getRoomModeratorsAndOwners....

16 lines
391 B

Meteor.methods
getRoomModeratorsAndOwners: (rid) ->
unless Meteor.userId()
throw new Meteor.Error 'invalid-user', '[methods] getRoomModeratorsAndOwners -> Invalid user'
check rid, String
options =
sort:
"u.username": 1
fields:
rid: 1
u: 1
roles: 1
return RocketChat.models.Subscriptions.findByRoomIdAndRoles(rid, ['moderator', 'owner'], options).fetch()