mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
654 B
37 lines
654 B
7 years ago
|
/**
|
||
|
* Right schema
|
||
|
*/
|
||
|
module.exports = (sequelize, DataTypes) => {
|
||
|
let rightSchema = sequelize.define('right', {
|
||
|
path: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: false
|
||
|
},
|
||
|
role: {
|
||
|
type: DataTypes.ENUM('read', 'write', 'manage'),
|
||
|
allowNull: false,
|
||
|
defaultValue: 'read'
|
||
|
},
|
||
|
exact: {
|
||
|
type: DataTypes.BOOLEAN,
|
||
|
allowNull: false,
|
||
|
defaultValue: false
|
||
|
},
|
||
|
allow: {
|
||
|
type: DataTypes.BOOLEAN,
|
||
|
allowNull: false,
|
||
|
defaultValue: false
|
||
|
}
|
||
|
}, {
|
||
|
timestamps: true,
|
||
|
version: true,
|
||
|
indexes: [
|
||
|
{
|
||
|
fields: ['path']
|
||
|
}
|
||
|
]
|
||
|
})
|
||
|
|
||
|
return rightSchema
|
||
|
}
|