diff options
Diffstat (limited to 'client/js/controllers/base_post_controller.js')
| -rw-r--r-- | client/js/controllers/base_post_controller.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/client/js/controllers/base_post_controller.js b/client/js/controllers/base_post_controller.js new file mode 100644 index 0000000..b86aea7 --- /dev/null +++ b/client/js/controllers/base_post_controller.js @@ -0,0 +1,20 @@ +'use strict'; + +const api = require('../api.js'); +const topNavigation = require('../models/top_navigation.js'); +const EmptyView = require('../views/empty_view.js'); + +class BasePostController { + constructor(ctx) { + if (!api.hasPrivilege('posts:view')) { + this._view = new EmptyView(); + this._view.showError('You don\'t have privileges to view posts.'); + return; + } + + topNavigation.activate('posts'); + topNavigation.setTitle('Post #' + ctx.parameters.id.toString()); + } +} + +module.exports = BasePostController; |