mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-24 09:20:32 +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
@@ -147,15 +147,19 @@ describe('helpers', () => {
|
||||
find: true,
|
||||
read: true,
|
||||
};
|
||||
const html = helpers.spawnPrivilegeStates('guests', privs);
|
||||
const types = {
|
||||
find: 'viewing',
|
||||
read: 'viewing',
|
||||
};
|
||||
const html = helpers.spawnPrivilegeStates('guests', privs, types);
|
||||
assert.equal(html, `
|
||||
<td data-privilege="find" data-value="true">
|
||||
<td data-privilege="find" data-value="true" data-type="viewing">
|
||||
<div class="form-check text-center">
|
||||
<input class="form-check-input float-none" autocomplete="off" type="checkbox" checked />
|
||||
</div>
|
||||
</td>
|
||||
\t\t\t
|
||||
<td data-privilege="read" data-value="true">
|
||||
<td data-privilege="read" data-value="true" data-type="viewing">
|
||||
<div class="form-check text-center">
|
||||
<input class="form-check-input float-none" autocomplete="off" type="checkbox" checked />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user