mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Improve canEdit permissions for attachments
This commit is contained in:
parent
8c2bed283f
commit
30d3e6f82e
1 changed files with 2 additions and 2 deletions
|
@ -25,9 +25,9 @@ export default Component.extend(Modals, Notifier, {
|
|||
hasAttachments: notEmpty('files'),
|
||||
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('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;
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue