Disallow rows with no permissions set
This commit is contained in:
parent
90dae04fb7
commit
74969ed606
1 changed files with 4 additions and 0 deletions
|
@ -34,6 +34,10 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
addPermission(formId, role, permissions) {
|
addPermission(formId, role, permissions) {
|
||||||
|
if (Object.values(permissions).every(p => p === false)) {
|
||||||
|
document.getElementById(`${formId}Input`)
|
||||||
|
.setCustomValidity('No permissions selected');
|
||||||
|
}
|
||||||
if (this.permissions.some(p => p.role === role)) {
|
if (this.permissions.some(p => p.role === role)) {
|
||||||
document.getElementById(`${formId}Input`)
|
document.getElementById(`${formId}Input`)
|
||||||
.setCustomValidity('Role entry already exists');
|
.setCustomValidity('Role entry already exists');
|
||||||
|
|
Loading…
Reference in a new issue