mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 12:53:13 +03:00
31 lines
648 B
JavaScript
31 lines
648 B
JavaScript
|
(function () {
|
||
|
"use strict";
|
||
|
|
||
|
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
|
||
|
};
|
||
|
|
||
|
}());
|