59 lines
1.0 KiB
JavaScript
Raw Normal View History

'use strict';
/**
* Lifecycle callbacks for the `Role` model.
*/
2021-05-17 16:34:19 +02:00
module.exports = {
collectionName: 'strapi_roles',
info: {
name: 'Role',
description: '',
},
options: {
timestamps: true,
},
pluginOptions: {
'content-manager': {
visible: false,
},
'content-type-builder': {
visible: false,
},
},
attributes: {
name: {
type: 'string',
minLength: 1,
unique: true,
configurable: false,
required: true,
},
code: {
type: 'string',
minLength: 1,
unique: true,
configurable: false,
required: true,
},
description: {
type: 'string',
configurable: false,
},
users: {
configurable: false,
2021-06-22 17:13:11 +02:00
type: 'relation',
relation: 'manyToMany',
mappedBy: 'roles',
target: 'strapi::user',
2021-05-17 16:34:19 +02:00
},
permissions: {
configurable: false,
2021-06-22 17:13:11 +02:00
type: 'relation',
relation: 'oneToMany',
mappedBy: 'role',
target: 'strapi::permission',
2021-05-17 16:34:19 +02:00
},
},
};