Ghost/core/server/models/permission.js
Sebastian Gierlinger c0dc8e95d2 Add new permissions to fixtures
closes #2325
- added new permissions
- added relation to user roles
- added updateFixtures to migrateUp
- removed validation per model to fix tests
2014-04-16 18:16:10 +02:00

34 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
};