mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
c0dc8e95d2
closes #2325 - added new permissions - added relation to user roles - added updateFixtures to migrateUp - removed validation per model to fix tests
33 lines
661 B
JavaScript
33 lines
661 B
JavaScript
var ghostBookshelf = require('./base'),
|
|
User = require('./user').User,
|
|
Role = require('./role').Role,
|
|
App = require('./app').App,
|
|
|
|
Permission,
|
|
Permissions;
|
|
|
|
Permission = ghostBookshelf.Model.extend({
|
|
|
|
tableName: 'permissions',
|
|
|
|
roles: function () {
|
|
return this.belongsToMany(Role);
|
|
},
|
|
|
|
users: function () {
|
|
return this.belongsToMany(User);
|
|
},
|
|
|
|
apps: function () {
|
|
return this.belongsToMany(App);
|
|
}
|
|
});
|
|
|
|
Permissions = ghostBookshelf.Collection.extend({
|
|
model: Permission
|
|
});
|
|
|
|
module.exports = {
|
|
Permission: Permission,
|
|
Permissions: Permissions
|
|
};
|