Ghost/core/shared/models/permission.js
Hannah Wolfe ba810fb0bb issue #58 - removing the iiwf
Function wrapper and use strict pragma removed from all node files
2013-06-25 13:46:50 +01:00

26 lines
523 B
JavaScript

var GhostBookshelf = require('./base'),
User = require('./user').User,
Role = require('./role').Role,
Permission,
Permissions;
Permission = GhostBookshelf.Model.extend({
tableName: 'permissions',
roles: function () {
return this.belongsToMany(Role);
},
users: function () {
return this.belongsToMany(User);
}
});
Permissions = GhostBookshelf.Collection.extend({
model: Permission
});
module.exports = {
Permission: Permission,
Permissions: Permissions
};