mirror of
https://github.com/documize/community.git
synced 2025-07-20 13:49:42 +02:00
Fix edge case for attachments download auth checks
Edit permissions no longer interfere with download checks.
This commit is contained in:
parent
2bbeaf91a0
commit
e37782e5b7
1 changed files with 9 additions and 9 deletions
|
@ -37,6 +37,15 @@ export default Component.extend(Modals, Notifier, {
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
||||||
|
// For authenticated users we send server auth token.
|
||||||
|
let qry = '';
|
||||||
|
if (this.get('session.hasSecureToken')) {
|
||||||
|
qry = '?secure=' + this.get('session.secureToken');
|
||||||
|
} else if (this.get('session.authenticated')) {
|
||||||
|
qry = '?token=' + this.get('session.authToken');
|
||||||
|
}
|
||||||
|
this.set('downloadQuery', qry);
|
||||||
|
|
||||||
if (!this.get('permissions.documentEdit') || this.get('document.protection') === this.get('constants').ProtectionType.Lock) {
|
if (!this.get('permissions.documentEdit') || this.get('document.protection') === this.get('constants').ProtectionType.Lock) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -86,15 +95,6 @@ export default Component.extend(Modals, Notifier, {
|
||||||
dzone.removeFile(file);
|
dzone.removeFile(file);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// For authenticated users we send server auth token.
|
|
||||||
let qry = '';
|
|
||||||
if (this.get('session.hasSecureToken')) {
|
|
||||||
qry = '?secure=' + this.get('session.secureToken');
|
|
||||||
} else if (this.get('session.authenticated')) {
|
|
||||||
qry = '?token=' + this.get('session.authToken');
|
|
||||||
}
|
|
||||||
this.set('downloadQuery', qry);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getAttachments() {
|
getAttachments() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue