Updated role model and created perm model in API

This commit is contained in:
Alexis
2021-01-02 12:32:24 +01:00
parent 5cf2c1daa7
commit 16b7b81166
2 changed files with 19 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
const bookshelf = require('../database/bookshelf').bookshelf
require('./role-model')
let Permission = bookshelf.Model.extend({
tableName: 'permission',
hidden: [ 'id' ],
role() {
return this.belongsToMany( 'Role', 'role_permission' )
}
})
module.exports = bookshelf.model( 'Permission', Permission );