mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-03 00:15:11 +03:00
Fixed unsafeAttributes fetching in Admin API v2
no issue - This check was misside and only was implemented for canary.
This commit is contained in:
parent
27e77dda80
commit
4a10ddc8fa
@ -26,7 +26,12 @@ const nonePublicAuth = (apiConfig, frame) => {
|
||||
permissionIdentifier = apiConfig.identifier(frame);
|
||||
}
|
||||
|
||||
const unsafeAttrObject = apiConfig.unsafeAttrs && _.has(frame, `data.[${apiConfig.docName}][0]`) ? _.pick(frame.data[apiConfig.docName][0], apiConfig.unsafeAttrs) : {};
|
||||
let unsafeAttrObject = apiConfig.unsafeAttrs && _.has(frame, `data.[${apiConfig.docName}][0]`) ? _.pick(frame.data[apiConfig.docName][0], apiConfig.unsafeAttrs) : {};
|
||||
|
||||
if (apiConfig.unsafeAttrsObject) {
|
||||
unsafeAttrObject = apiConfig.unsafeAttrsObject(frame);
|
||||
}
|
||||
|
||||
const permsPromise = permissions.canThis(frame.options.context)[apiConfig.method][singular](permissionIdentifier, unsafeAttrObject);
|
||||
|
||||
return permsPromise.then((result) => {
|
||||
|
Loading…
Reference in New Issue
Block a user