* 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:
Barış Soner Uşaklı
2023-09-25 20:42:18 -04:00
committed by GitHub
parent c1f873b302
commit f1a80d48cc
15 changed files with 607 additions and 402 deletions

View File

@@ -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>