[FIX] Some typos in the error message names (#11136)

Some places were returning `error-action-now-allowed` instead of `error-action-not-allowed`, which is all a bit confusing but definitely should not be the case.
pull/10447/head
フィンメラ 8 years ago committed by Guilherme Gazzo
parent db0edc4338
commit bcbb97bf02
  1. 6
      packages/rocketchat-assets/server/assets.js
  2. 2
      packages/rocketchat-autotranslate/server/methods/getSupportedLanguages.js
  3. 2
      packages/rocketchat-autotranslate/server/methods/saveSettings.js

@ -396,7 +396,7 @@ Meteor.methods({
const hasPermission = RocketChat.authz.hasPermission(Meteor.userId(), 'manage-assets');
if (!hasPermission) {
throw new Meteor.Error('error-action-now-allowed', 'Managing assets not allowed', {
throw new Meteor.Error('error-action-not-allowed', 'Managing assets not allowed', {
method: 'refreshClients',
action: 'Managing_assets'
});
@ -414,7 +414,7 @@ Meteor.methods({
const hasPermission = RocketChat.authz.hasPermission(Meteor.userId(), 'manage-assets');
if (!hasPermission) {
throw new Meteor.Error('error-action-now-allowed', 'Managing assets not allowed', {
throw new Meteor.Error('error-action-not-allowed', 'Managing assets not allowed', {
method: 'unsetAsset',
action: 'Managing_assets'
});
@ -432,7 +432,7 @@ Meteor.methods({
const hasPermission = RocketChat.authz.hasPermission(Meteor.userId(), 'manage-assets');
if (!hasPermission) {
throw new Meteor.Error('error-action-now-allowed', 'Managing assets not allowed', {
throw new Meteor.Error('error-action-not-allowed', 'Managing assets not allowed', {
method: 'setAsset',
action: 'Managing_assets'
});

@ -1,7 +1,7 @@
Meteor.methods({
'autoTranslate.getSupportedLanguages'(targetLanguage) {
if (!RocketChat.authz.hasPermission(Meteor.userId(), 'auto-translate')) {
throw new Meteor.Error('error-action-now-allowed', 'Auto-Translate is not allowed', { method: 'autoTranslate.saveSettings'});
throw new Meteor.Error('error-action-not-allowed', 'Auto-Translate is not allowed', { method: 'autoTranslate.saveSettings'});
}
return RocketChat.AutoTranslate.getSupportedLanguages(targetLanguage);

@ -5,7 +5,7 @@ Meteor.methods({
}
if (!RocketChat.authz.hasPermission(Meteor.userId(), 'auto-translate')) {
throw new Meteor.Error('error-action-now-allowed', 'Auto-Translate is not allowed', { method: 'autoTranslate.saveSettings'});
throw new Meteor.Error('error-action-not-allowed', 'Auto-Translate is not allowed', { method: 'autoTranslate.saveSettings'});
}
check(rid, String);

Loading…
Cancel
Save