mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
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:
@@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user