mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 17:08:45 +00:00
Validate permission role input exists
This commit is contained in:
parent
76f86c74ad
commit
f278517276
2 changed files with 4 additions and 1 deletions
|
|
@ -511,6 +511,8 @@ $logs = $this->getParam('logs', null);
|
|||
<div class="row responsive margin-top-negative">
|
||||
<div class="col span-8 margin-bottom">
|
||||
|
||||
<form id="permissions"></form>
|
||||
|
||||
<form
|
||||
data-analytics
|
||||
data-analytics-activity
|
||||
|
|
@ -595,7 +597,7 @@ $logs = $this->getParam('logs', null);
|
|||
<option value="any">
|
||||
</datalist>
|
||||
|
||||
<input type="text" name="role" x-model="role" list="types" />
|
||||
<input required id="role" form="permissions" type="text" name="role" x-model="role" list="types" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="read" x-model="read" />
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
return { type, role };
|
||||
},
|
||||
addPermission(role, read, create, update, xdelete) {
|
||||
if (!document.getElementById('role').reportValidity()) return;
|
||||
if (read) this.rawPermissions.push(`read(${role})`);
|
||||
if (create) this.rawPermissions.push(`create(${role})`);
|
||||
if (update) this.rawPermissions.push(`update(${role})`);
|
||||
|
|
|
|||
Loading…
Reference in a new issue