Ghost/core/server/models/permission.js
Fabian Becker 1a9e91f120 Replace JSLint with JSHint.
closes #2277
- Added ES6 linting to core/client/
- Fix typeof array comparison
2014-03-04 15:47:39 +00:00

29 lines
546 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
};