mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 23:40:38 +01:00
10411 (#12037)
* feat: add type to privilege maps deprecate old hooks that are used for adding new privileges, new hooks are static:privileges.global.init/static:privileges.categories.init * deprecate admin priv hooks * fix: if type doesnt exist default to 'other' * remove filter * fix: copy privilege functions to use new filter instead of indices allow static hooks to use sync functions * fix: openapi * test: fix template helper
This commit is contained in:
committed by
GitHub
parent
c1f873b302
commit
f1a80d48cc
@@ -173,13 +173,14 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
return '';
|
||||
}
|
||||
|
||||
function spawnPrivilegeStates(member, privileges) {
|
||||
function spawnPrivilegeStates(member, privileges, types) {
|
||||
const states = [];
|
||||
for (const priv in privileges) {
|
||||
if (privileges.hasOwnProperty(priv)) {
|
||||
states.push({
|
||||
name: priv,
|
||||
state: privileges[priv],
|
||||
type: types[priv],
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -193,7 +194,7 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
(member === 'Global Moderators' && globalModDisabled.includes(priv.name));
|
||||
|
||||
return `
|
||||
<td data-privilege="${priv.name}" data-value="${priv.state}">
|
||||
<td data-privilege="${priv.name}" data-value="${priv.state}" data-type="${priv.type}">
|
||||
<div class="form-check text-center">
|
||||
<input class="form-check-input float-none" autocomplete="off" type="checkbox"${(priv.state ? ' checked' : '')}${(disabled ? ' disabled="disabled"' : '')} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user