2021-06-24 09:12:18 +02:00

59 lines
1.0 KiB
JavaScript

'use strict';
/**
* Lifecycle callbacks for the `Role` model.
*/
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,
type: 'relation',
relation: 'manyToMany',
mappedBy: 'roles',
target: 'strapi::user',
},
permissions: {
configurable: false,
type: 'relation',
relation: 'oneToMany',
mappedBy: 'role',
target: 'strapi::permission',
},
},
};