mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Disallow multiple entries for the same role
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user