feat: privileges for Admin Control Panel (#8355)

* feat: acp privileges (WIP)

* fix: restore global privilege hooks

* refactor: using cid 0 in admin privs

* fix: no need for zebrastripe-reset

* feat: manage:categories privilege WIP

* feat: renamed prefix to admin:, settigns and dashboard privs

* fix: nofocus on acp privs group find modal

* refactor: privileges.x.get() to not used hardcoded privs

* fix: crash if unable to get latest version

* feat: setting acp priv

* Revert "fix: crash if unable to get latest version"

This reverts commit afdb235f48.

* feat: user/privilege acp privs

* fix: category selector in manage/privileges

* fix: guests potentially becoming admins

* fix: bug in setting admin privs

* fix: some last minute things + api docs

* fix: some more last minute fixes
This commit is contained in:
Julian Lam
2020-06-05 15:26:51 -04:00
committed by GitHub
parent 7f6ff0b1a5
commit a82e9bd7f6
23 changed files with 343 additions and 53 deletions

View File

@@ -16,11 +16,12 @@ const utils = require('../../utils');
const dashboardController = module.exports;
dashboardController.get = async function (req, res) {
const [stats, notices, latestVersion, lastrestart] = await Promise.all([
const [stats, notices, latestVersion, lastrestart, isAdmin] = await Promise.all([
getStats(),
getNotices(),
getLatestVersion(),
getLastRestart(),
user.isAdministrator(),
]);
const version = nconf.get('version');
@@ -34,6 +35,7 @@ dashboardController.get = async function (req, res) {
stats: stats,
canRestart: !!process.send,
lastrestart: lastrestart,
showSystemControls: isAdmin,
});
};