mirror of
https://github.com/strapi/strapi.git
synced 2025-11-23 13:40:58 +00:00
Fix policies detection
This commit is contained in:
parent
54c7f03c31
commit
23584dc7c1
@ -16,7 +16,7 @@ module.exports = (api, controller) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_.isObject(controller) && controller.hasOwnProperty('identity')) {
|
if (_.isObject(controller) && controller.hasOwnProperty('identity')) {
|
||||||
controller = controller.identity;
|
controller = controller.identity.toLowerCase();
|
||||||
} else if (_.isString(controller)) {
|
} else if (_.isString(controller)) {
|
||||||
controller = controller.toLowerCase();
|
controller = controller.toLowerCase();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -88,7 +88,7 @@ module.exports = strapi => function routerChecker(value, endpoint, plugin) {
|
|||||||
} else if (
|
} else if (
|
||||||
_.startsWith(policy, pluginPolicyPrefix, 0) &&
|
_.startsWith(policy, pluginPolicyPrefix, 0) &&
|
||||||
strapi.plugins[policySplited[1]] &&
|
strapi.plugins[policySplited[1]] &&
|
||||||
!_.isEmpty(
|
!_.isUndefined(
|
||||||
_.get(
|
_.get(
|
||||||
strapi.plugins,
|
strapi.plugins,
|
||||||
policySplited[1] +
|
policySplited[1] +
|
||||||
@ -109,7 +109,7 @@ module.exports = strapi => function routerChecker(value, endpoint, plugin) {
|
|||||||
} else if (
|
} else if (
|
||||||
!_.startsWith(policy, globalPolicyPrefix, 0) &&
|
!_.startsWith(policy, globalPolicyPrefix, 0) &&
|
||||||
plugin &&
|
plugin &&
|
||||||
!_.isEmpty(
|
!_.isUndefined(
|
||||||
_.get(
|
_.get(
|
||||||
strapi.plugins,
|
strapi.plugins,
|
||||||
plugin + '.config.policies.' + policy.toLowerCase()
|
plugin + '.config.policies.' + policy.toLowerCase()
|
||||||
@ -125,7 +125,7 @@ module.exports = strapi => function routerChecker(value, endpoint, plugin) {
|
|||||||
);
|
);
|
||||||
} else if (
|
} else if (
|
||||||
!_.startsWith(policy, globalPolicyPrefix, 0) &&
|
!_.startsWith(policy, globalPolicyPrefix, 0) &&
|
||||||
!_.isEmpty(
|
!_.isUndefined(
|
||||||
_.get(
|
_.get(
|
||||||
strapi.api,
|
strapi.api,
|
||||||
currentApiName + '.config.policies.' + policy.toLowerCase()
|
currentApiName + '.config.policies.' + policy.toLowerCase()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user