1
0
Fork 0
mirror of synced 2024-06-13 16:24:47 +12:00

Explicitly set all permissions to false on first add

This commit is contained in:
Jake Barnby 2022-09-13 16:14:37 +12:00
parent 9cea1270c3
commit c4e5ff4c94
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -22,10 +22,15 @@
}
})
if (existing === undefined) {
this.permissions.push({
let newPermission = {
role,
[type]: true,
});
create: false,
read: false,
update: false,
xdelete: false,
};
newPermission[type] = true;
this.permissions.push(newPermission);
}
if (index !== -1) {
existing[type] = true;
@ -38,7 +43,13 @@
&& !this.validate(formId, this.permissions.length - 1)) {
return;
}
this.permissions.push({role: ''});
this.permissions.push({
role: '',
create: false,
read: false,
update: false,
xdelete: false,
});
},
updatePermission(index) {
// Because the x-model does not update before the click event,