aboutsummaryrefslogtreecommitdiff
path: root/client/js/controllers/base_post_controller.js
blob: b86aea721daf8f50de0c4c63cd737e991c1570e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;

© 2015 - 2026 Jakob L. Kreuze