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-integrations/server/methods/outgoing/deleteOutgoingIntegration.c...

13 lines
536 B

Meteor.methods
deleteOutgoingIntegration: (integrationId) ->
if not RocketChat.authz.hasPermission(@userId, 'manage-integrations') and not RocketChat.authz.hasPermission(@userId, 'manage-integrations', 'bot')
throw new Meteor.Error 'not_authorized'
integration = RocketChat.models.Integrations.findOne(integrationId)
if not integration?
throw new Meteor.Error 'invalid_integration', '[methods] deleteOutgoingIntegration -> integration not found'
RocketChat.models.Integrations.remove _id: integrationId
return true