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/packages/rocketchat-lib/server/methods/saveSetting.coffee

11 lines
366 B

Meteor.methods
saveSetting: (_id, value) ->
if Meteor.userId()?
user = Meteor.users.findOne Meteor.userId()
unless RocketChat.authz.hasPermission(Meteor.userId(), 'edit-privileged-setting') is true
throw new Meteor.Error 503, 'Not authorized'
# console.log "saveSetting -> ".green, _id, value
RocketChat.settings.updateById _id, value
return true