Ghost/core/shared/models/role.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

27 lines
494 B
JavaScript

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