Disallow multiple entries for the same role
This commit is contained in:
parent
33152c7bb1
commit
90dae04fb7
2 changed files with 5 additions and 1 deletions
|
@ -91,7 +91,7 @@ $escapedPermissions = \array_map(function ($perm) {
|
|||
|
||||
<input
|
||||
required
|
||||
id="<?php echo $form; ?>"
|
||||
id="<?php echo $form; ?>Input"
|
||||
name="<?php echo $form; ?>"
|
||||
form="<?php echo $form ?>"
|
||||
list="types"
|
||||
|
|
|
@ -34,6 +34,10 @@
|
|||
});
|
||||
},
|
||||
addPermission(formId, role, permissions) {
|
||||
if (this.permissions.some(p => p.role === role)) {
|
||||
document.getElementById(`${formId}Input`)
|
||||
.setCustomValidity('Role entry already exists');
|
||||
}
|
||||
if (!document.getElementById(formId).reportValidity()) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue