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-oauth2-server-co.../server/admin/methods/deleteOAuthApp.js

17 lines
634 B

import { Meteor } from 'meteor/meteor';
import { hasPermission } from 'meteor/rocketchat:authorization';
import { OAuthApps } from 'meteor/rocketchat:models';
Meteor.methods({
deleteOAuthApp(applicationId) {
if (!hasPermission(this.userId, 'manage-oauth-apps')) {
throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'deleteOAuthApp' });
}
const application = OAuthApps.findOne(applicationId);
if (application == null) {
throw new Meteor.Error('error-application-not-found', 'Application not found', { method: 'deleteOAuthApp' });
}
OAuthApps.remove({ _id: applicationId });
return true;
},
});