Apply `redirectUnauthorized: false` when saving roles

- There's situations where the user does not have permision to create certain rules
- In those cases ensure we don't log the user out
This commit is contained in:
Richard Cox 2021-04-13 14:09:22 +01:00
parent a1b512194b
commit 0036deb72e
1 changed files with 12 additions and 0 deletions

View File

@ -245,6 +245,18 @@ export default {
cancel() {
this.done();
},
async actuallySave(url) {
if ( this.isCreate ) {
url = url || this.schema.linkFor('collection');
const res = await this.value.save({ url, redirectUnauthorized: false });
if (res) {
Object.assign(this.value, res);
}
} else {
await this.value.save({ redirectUnauthorized: false });
}
},
// Detail View
verbKey(verb) {
return `has${ ucFirst(verb) }`;