mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
Merge pull request #588 from strapi/fix/role
Populate type field when creating a role #553
This commit is contained in:
commit
12723d1f4a
@ -17,7 +17,11 @@ module.exports = {
|
||||
return new Error('This feature requires to install the Content Manager plugin');
|
||||
}
|
||||
|
||||
const role = await strapi.query('role', 'users-permissions').create(_.omit(params, ['users', 'permissions', 'type']));
|
||||
if (!params.type) {
|
||||
params.type = _.snakeCase(_.deburr(_.toLower(params.name)));
|
||||
}
|
||||
|
||||
const role = await strapi.query('role', 'users-permissions').create(_.omit(params, ['users', 'permissions']));
|
||||
|
||||
const arrayOfPromises = Object.keys(params.permissions).reduce((acc, type) => {
|
||||
Object.keys(params.permissions[type].controllers).forEach(controller => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user