mirror of
https://github.com/documize/community.git
synced 2025-07-23 15:19:42 +02:00
Ensure only change approvers can change doc level attachments
Does not affect section level attachments
This commit is contained in:
parent
d14e8a3ff6
commit
5b72da037c
1 changed files with 8 additions and 2 deletions
|
@ -23,8 +23,14 @@ export default Component.extend(Modals, Notifier, {
|
|||
appMeta: service(),
|
||||
session: service(),
|
||||
hasAttachments: notEmpty('files'),
|
||||
canEdit: computed('permissions.documentEdit', 'document.protection', function() {
|
||||
return this.get('document.protection') !== this.get('constants').ProtectionType.Lock && this.get('permissions.documentEdit');
|
||||
canEdit: computed('permissions.{documentApprove,documentEdit}', 'document.protection', function() {
|
||||
// Check to see if specific scenarios prevent us from changing doc level attachments.
|
||||
if (this.get('document.protection') == this.get('constants').ProtectionType.Lock) return false;
|
||||
if (!this.get('permissions.documentEdit')) return false;
|
||||
if (this.get('document.protection') == this.get('constants').ProtectionType.Review && !this.get('permissions.documentApprove')) return false;
|
||||
|
||||
// By default, we can edit/upload attachments that sit at the document level.
|
||||
return true;
|
||||
}),
|
||||
showDialog: false,
|
||||
downloadQuery: '',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue