diff --git a/public/language/en-GB/admin/manage/privileges.json b/public/language/en-GB/admin/manage/privileges.json index 8d9e59f86d..a6b39716fd 100644 --- a/public/language/en-GB/admin/manage/privileges.json +++ b/public/language/en-GB/admin/manage/privileges.json @@ -41,6 +41,7 @@ "admin-users": "Users", "admin-admins-mods": "Admins & Mods", "admin-groups": "Groups", + "admin-tags": "Tags", "admin-settings": "Settings", "alert.confirm-moderate": "Are you sure you wish to grant the moderation privilege to this user group? This group is public, and any users can join at will.", diff --git a/src/controllers/admin.js b/src/controllers/admin.js index 3ae851145a..d616a67a6a 100644 --- a/src/controllers/admin.js +++ b/src/controllers/admin.js @@ -46,6 +46,8 @@ adminController.routeIndex = async (req, res) => { return helpers.redirect(res, 'admin/manage/groups'); } else if (privilegeSet['admin:admins-mods']) { return helpers.redirect(res, 'admin/manage/admins-mods'); + } else if (privilegeSet['admin:tags']) { + return helpers.redirect(res, 'admin/manage/tags'); } else if (privilegeSet['admin:settings']) { return helpers.redirect(res, 'admin/settings/general'); } diff --git a/src/middleware/admin.js b/src/middleware/admin.js index 1a19d5c281..3c4cc9f9fc 100644 --- a/src/middleware/admin.js +++ b/src/middleware/admin.js @@ -73,7 +73,7 @@ middleware.renderHeader = async (req, res, data) => { version: version, latestVersion: results.latestVersion, upgradeAvailable: results.latestVersion && semver.gt(results.latestVersion, version), - showManageMenu: results.privileges.superadmin || ['categories', 'privileges', 'users', 'admins-mods', 'groups', 'settings'].some(priv => results.privileges[`admin:${priv}`]), + showManageMenu: results.privileges.superadmin || ['categories', 'privileges', 'users', 'admins-mods', 'groups', 'tags', 'settings'].some(priv => results.privileges[`admin:${priv}`]), }; templateValues.template = { name: res.locals.template }; diff --git a/src/privileges/admin.js b/src/privileges/admin.js index 9b4d07a732..95f0f27884 100644 --- a/src/privileges/admin.js +++ b/src/privileges/admin.js @@ -19,6 +19,7 @@ module.exports = function (privileges) { { name: '[[admin/manage/privileges:admin-admins-mods]]' }, { name: '[[admin/manage/privileges:admin-users]]' }, { name: '[[admin/manage/privileges:admin-groups]]' }, + { name: '[[admin/manage/privileges:admin-tags]]' }, { name: '[[admin/manage/privileges:admin-settings]]' }, ]; @@ -29,6 +30,7 @@ module.exports = function (privileges) { 'admin:admins-mods', 'admin:users', 'admin:groups', + 'admin:tags', 'admin:settings', ]; @@ -42,6 +44,8 @@ module.exports = function (privileges) { 'manage/admins-mods': 'admin:admins-mods', 'manage/users': 'admin:users', 'manage/groups': 'admin:groups', + 'manage/tags': 'admin:tags', + 'settings/tags': 'admin:tags', 'extend/plugins': 'admin:settings', 'extend/widgets': 'admin:settings', 'extend/rewards': 'admin:settings', @@ -89,6 +93,11 @@ module.exports = function (privileges) { 'admin.user.createUser': 'admin:users', 'admin.user.invite': 'admin:users', + 'admin.tags.create': 'admin:tags', + 'admin.tags.update': 'admin:tags', + 'admin.tags.rename': 'admin:tags', + 'admin.tags.deleteTags': 'admin:tags', + 'admin.getSearchDict': 'admin:settings', 'admin.config.setMultiple': 'admin:settings', 'admin.config.remove': 'admin:settings', diff --git a/src/views/admin/partials/menu.tpl b/src/views/admin/partials/menu.tpl index ef2e3f1e16..160c9ae69e 100644 --- a/src/views/admin/partials/menu.tpl +++ b/src/views/admin/partials/menu.tpl @@ -20,9 +20,9 @@ {{{ if user.privileges.admin:users }}}