Small note about global board management permissions, allow subtitles along with titles in permission metadata

indiachan-spamvector
Thomas Lynch 2 years ago
parent 058d7b1dbb
commit 7e3c424da3
  1. 8
      lib/permission/permission.js
  2. 2
      lib/permission/permissiontext.js
  3. 2
      views/pages/editrole.pug

@ -19,12 +19,14 @@ class Permission extends BigBitfield {
toJSON() {
return this.constructor.permissionEntries
.reduce((acc, entry) => {
const { label, desc, title, subtitle } = PermissionText[entry[0]];
acc[entry[0]] = {
bit: entry[1],
state: this.get(entry[1]),
label: PermissionText[entry[0]].label,
desc: PermissionText[entry[0]].desc,
title: PermissionText[entry[0]].title,
label,
desc,
title,
subtitle,
};
return acc;
}, {});

@ -19,7 +19,7 @@ module.exports = {
MANAGE_GLOBAL_SETTINGS: { label: 'Global Settings', desc: 'Access global settings. Ability to change any settings.' },
MANAGE_GLOBAL_ACCOUNTS: { label: 'Accounts', desc: 'Access the accounts list. Ability to search/sort. Ability to edit permissions of any user. Can only be given by somebody else with "Root" permission.' }, //view, delete, change account permissions
MANAGE_GLOBAL_ROLES: { label: 'Roles', desc: 'Access roles list. Ability to edit roles. Can only be given by somebody else with "Root" permission.' }, //view and edit roles
MANAGE_BOARD_OWNER: { title: 'Board Management', label: 'Board Owner', desc: 'Full control of the board, equivalent to the BO. Can delete and/or transfer the board. Can only be given by somebody else with "Board Owner" permission. Use with caution!' },
MANAGE_BOARD_OWNER: { title: 'Board Management', subtitle: 'Note: Setting board management permissions on an account/role level will grant them globally i.e for all boards.\nTo make somebody a normal board owner/staff, transfer them the board or give them the appropriate permissions in the board staff permission editing interface.', label: 'Board Owner', desc: 'Full control of the board, equivalent to the BO. Can delete and/or transfer the board. Can only be given by somebody else with "Board Owner" permission. Use with caution!' },
MANAGE_BOARD_GENERAL: { label: 'Board Staff', desc: 'General board staff permission. Access mod index, catalog, recent posts and reports. Ability to submit mod actions. Bypass board-specific bans and post filters.' },
MANAGE_BOARD_BANS: { label: 'Bans', desc: 'Access board bans. Ability to unban, edit, or deny appeals.' },
MANAGE_BOARD_LOGS: { label: 'Logs', desc: 'Access board logs. Ability to search/filter.' },

@ -19,6 +19,8 @@ block content
if jsonPermissions[perm].title && index > 0
hr(size=1)
h4.mv-5 #{jsonPermissions[perm].title}
if jsonPermissions[perm].subtitle
p #{jsonPermissions[perm].subtitle}
.row
label.postform-style.ph-5
input(type='checkbox' name=perm value=jsonPermissions[perm].bit checked=jsonPermissions[perm].state)

Loading…
Cancel
Save