mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-01 02:41:39 -05:00
Removed duplicate logic from settings edit permissions stage
refs https://github.com/TryGhost/Team/issues/694 refs https://linear.app/tryghost/issue/CORE-13 - The removed logic is done more thoroughly on the settings BREAD service layer.
This commit is contained in:
parent
6b25b91fa4
commit
e7ec197da1
2 changed files with 1 additions and 12 deletions
|
@ -193,18 +193,6 @@ module.exports = {
|
|||
permissions: {
|
||||
unsafeAttrsObject(frame) {
|
||||
return _.find(frame.data.settings, {key: 'labs'});
|
||||
},
|
||||
async before(frame) {
|
||||
if (frame.options.context && frame.options.context.internal) {
|
||||
return;
|
||||
}
|
||||
|
||||
const firstCoreSetting = frame.data.settings.find(setting => setting.group === 'core');
|
||||
if (firstCoreSetting) {
|
||||
throw new NoPermissionError({
|
||||
message: i18n.t('errors.api.settings.accessCoreSettingFromExtReq')
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
async query(frame) {
|
||||
|
|
|
@ -116,6 +116,7 @@ class SettingsBREADService {
|
|||
|
||||
if (!(options.context && options.context.internal)) {
|
||||
const firstCoreSetting = filteredSettings.find(setting => getSetting(setting).group === 'core');
|
||||
|
||||
if (firstCoreSetting) {
|
||||
throw new NoPermissionError({
|
||||
message: tpl(messages.accessCoreSettingFromExtReq)
|
||||
|
|
Loading…
Add table
Reference in a new issue