Added user-interface for "Everyone Else" entity permission item

Nothing on back-end logic done to hook this new option up.
Addition of permissions for role_id=0 works out of the box, but active
"everyone else" permissions, with no priviliges, is currently not
working. Needs change of permission gen logic also.
This commit is contained in:
Dan Brown
2022-10-02 18:09:48 +01:00
parent b8b0afa0df
commit a03245e427
10 changed files with 87 additions and 17 deletions

View File

@ -0,0 +1,24 @@
class EntityPermissions {
setup() {
this.everyoneInheritToggle = this.$refs.everyoneInherit;
this.setupListeners();
}
setupListeners() {
this.everyoneInheritToggle.addEventListener('change', event => {
const inherit = event.target.checked;
const permissions = document.querySelectorAll('input[type="checkbox"][name^="restrictions[0]["]');
for (const permission of permissions) {
permission.disabled = inherit;
permission.checked = false;
}
})
}
}
export default EntityPermissions;

View File

@ -18,6 +18,7 @@ import dropdown from "./dropdown.js"
import dropdownSearch from "./dropdown-search.js"
import dropzone from "./dropzone.js"
import editorToolbox from "./editor-toolbox.js"
import entityPermissions from "./entity-permissions";
import entitySearch from "./entity-search.js"
import entitySelector from "./entity-selector.js"
import entitySelectorPopup from "./entity-selector-popup.js"
@ -74,6 +75,7 @@ const componentMapping = {
"dropdown-search": dropdownSearch,
"dropzone": dropzone,
"editor-toolbox": editorToolbox,
"entity-permissions": entityPermissions,
"entity-search": entitySearch,
"entity-selector": entitySelector,
"entity-selector-popup": entitySelectorPopup,