Explicitly set all permissions to false on first add
This commit is contained in:
parent
9cea1270c3
commit
c4e5ff4c94
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue