mirror of
https://github.com/strapi/strapi.git
synced 2025-07-22 16:37:13 +00:00
22 lines
521 B
JavaScript
22 lines
521 B
JavaScript
const _ = require('lodash');
|
|
|
|
module.exports = strapi => {
|
|
return {
|
|
initialize: function(cb) {
|
|
_.forEach(strapi.config.routes, value => {
|
|
value.config.policies.unshift('plugins.users-permissions.permissions');
|
|
});
|
|
|
|
if (strapi.plugins) {
|
|
_.forEach(strapi.plugins, (plugin, name) => {
|
|
_.forEach(plugin.config.routes, value => {
|
|
value.config.policies.unshift('plugins.users-permissions.permissions');
|
|
});
|
|
});
|
|
}
|
|
|
|
cb();
|
|
}
|
|
};
|
|
};
|