diff --git a/packages/strapi-utils/lib/finder.js b/packages/strapi-utils/lib/finder.js index bcfbe816a0..b388d1fe7a 100644 --- a/packages/strapi-utils/lib/finder.js +++ b/packages/strapi-utils/lib/finder.js @@ -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 { diff --git a/packages/strapi/lib/middlewares/router/utils/routerChecker.js b/packages/strapi/lib/middlewares/router/utils/routerChecker.js index fc0ee36e3d..92b502a670 100644 --- a/packages/strapi/lib/middlewares/router/utils/routerChecker.js +++ b/packages/strapi/lib/middlewares/router/utils/routerChecker.js @@ -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()