mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
192ebb1739
refs #9178 - move tests as well
25 lines
683 B
JavaScript
25 lines
683 B
JavaScript
// canThis(someUser).edit.posts([id]|[[ids]])
|
|
// canThis(someUser).edit.post(somePost|somePostId)
|
|
|
|
var models = require('../../models'),
|
|
actionsMap = require('./actions-map-cache'),
|
|
init;
|
|
|
|
init = function init(options) {
|
|
options = options || {};
|
|
|
|
// Load all the permissions
|
|
return models.Permission.findAll(options)
|
|
.then(function (permissionsCollection) {
|
|
return actionsMap.init(permissionsCollection);
|
|
});
|
|
};
|
|
|
|
module.exports = {
|
|
init: init,
|
|
canThis: require('./can-this'),
|
|
// @TODO: Make it so that we don't need to export these
|
|
parseContext: require('./parse-context'),
|
|
applyPublicRules: require('./public')
|
|
};
|