mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-01 02:41:39 -05:00
Replaced i18n.t w/ tpl helper in permissions (#13419)
refs: #13380 The i18n package is deprecated. It is being replaced with the tpl package. Co-authored-by: Kenneth Fitzgerald <fitzgeraldkd@gmail.com>
This commit is contained in:
parent
1e73f0b07a
commit
31b998e1e1
1 changed files with 6 additions and 2 deletions
|
@ -2,9 +2,13 @@ const debug = require('@tryghost/debug')('api:canary:utils:permissions');
|
|||
const Promise = require('bluebird');
|
||||
const _ = require('lodash');
|
||||
const permissions = require('../../../services/permissions');
|
||||
const i18n = require('../../../../shared/i18n');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
const errors = require('@tryghost/errors');
|
||||
|
||||
const messages = {
|
||||
noPermissionToCall: 'You do not have permission to {method} {docName}'
|
||||
};
|
||||
|
||||
/**
|
||||
* @description Handle requests, which need authentication.
|
||||
*
|
||||
|
@ -55,7 +59,7 @@ const nonePublicAuth = (apiConfig, frame) => {
|
|||
}
|
||||
}).catch((err) => {
|
||||
if (err instanceof errors.NoPermissionError) {
|
||||
err.message = i18n.t('errors.api.utils.noPermissionToCall', {
|
||||
err.message = tpl(messages.noPermissionToCall, {
|
||||
method: apiConfig.method,
|
||||
docName: apiConfig.docName
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue