mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 10:23:34 +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')) {
|
||||
controller = controller.identity;
|
||||
controller = controller.identity.toLowerCase();
|
||||
} else if (_.isString(controller)) {
|
||||
controller = controller.toLowerCase();
|
||||
} else {
|
||||
|
||||
@ -88,7 +88,7 @@ module.exports = strapi => function routerChecker(value, endpoint, plugin) {
|
||||
} else if (
|
||||
_.startsWith(policy, pluginPolicyPrefix, 0) &&
|
||||
strapi.plugins[policySplited[1]] &&
|
||||
!_.isEmpty(
|
||||
!_.isUndefined(
|
||||
_.get(
|
||||
strapi.plugins,
|
||||
policySplited[1] +
|
||||
@ -109,7 +109,7 @@ module.exports = strapi => function routerChecker(value, endpoint, plugin) {
|
||||
} else if (
|
||||
!_.startsWith(policy, globalPolicyPrefix, 0) &&
|
||||
plugin &&
|
||||
!_.isEmpty(
|
||||
!_.isUndefined(
|
||||
_.get(
|
||||
strapi.plugins,
|
||||
plugin + '.config.policies.' + policy.toLowerCase()
|
||||
@ -125,7 +125,7 @@ module.exports = strapi => function routerChecker(value, endpoint, plugin) {
|
||||
);
|
||||
} else if (
|
||||
!_.startsWith(policy, globalPolicyPrefix, 0) &&
|
||||
!_.isEmpty(
|
||||
!_.isUndefined(
|
||||
_.get(
|
||||
strapi.api,
|
||||
currentApiName + '.config.policies.' + policy.toLowerCase()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user