mirror of
https://github.com/documize/community.git
synced 2025-07-21 06:09:42 +02:00
Quick-abort space settings save operation if no permission
This commit is contained in:
parent
419ce1bbb5
commit
ecc306136a
1 changed files with 1 additions and 9 deletions
|
@ -30,21 +30,13 @@ export default Component.extend(Notifier, {
|
||||||
actions: {
|
actions: {
|
||||||
onSave() {
|
onSave() {
|
||||||
if (this.get('hasNameError')) return;
|
if (this.get('hasNameError')) return;
|
||||||
|
if (!this.get('permissions.documentEdit')) return;
|
||||||
let constants = this.get('constants');
|
|
||||||
|
|
||||||
this.set('document.name', this.get('docName'));
|
this.set('document.name', this.get('docName'));
|
||||||
this.set('document.excerpt', this.get('docExcerpt').trim());
|
this.set('document.excerpt', this.get('docExcerpt').trim());
|
||||||
|
|
||||||
let lifecycle = this.get('lifecycle.selected');
|
|
||||||
this.set('document.lifecycle', lifecycle);
|
|
||||||
|
|
||||||
let cb = this.get('onSaveDocument');
|
let cb = this.get('onSaveDocument');
|
||||||
cb(this.get('document'));
|
cb(this.get('document'));
|
||||||
|
|
||||||
if (lifecycle === constants.Lifecycle.Draft) {
|
|
||||||
this.get('activitySvc').clearChangeHistory(this.get('document.id'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue