From 6abdc001e5e10addde04cfef99bb685d9e14b6da Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 8 Feb 2016 11:56:47 +0200 Subject: [PATCH] attachment: forbid parent --- application/Espo/Jobs/Cleanup.php | 4 ---- application/Espo/Resources/metadata/app/acl.json | 3 +++ application/Espo/Resources/metadata/app/aclPortal.json | 3 +++ frontend/client/src/views/fields/file.js | 2 -- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/Espo/Jobs/Cleanup.php b/application/Espo/Jobs/Cleanup.php index 6f2c6e1654..d9546e3544 100644 --- a/application/Espo/Jobs/Cleanup.php +++ b/application/Espo/Jobs/Cleanup.php @@ -97,10 +97,6 @@ class Cleanup extends \Espo\Core\Jobs\Base 'OR' => array( array( 'role' => ['Export File'] - ), - array( - 'role' => ['Attachment'], - 'parentId' => null ) ), 'createdAt<' => $dateBefore diff --git a/application/Espo/Resources/metadata/app/acl.json b/application/Espo/Resources/metadata/app/acl.json index 3dc7867d1b..d46f336ee9 100644 --- a/application/Espo/Resources/metadata/app/acl.json +++ b/application/Espo/Resources/metadata/app/acl.json @@ -62,6 +62,9 @@ "fieldLevel": { }, "scopeFieldLevel": { + "Attachment": { + "parent": false + } } }, "default": { diff --git a/application/Espo/Resources/metadata/app/aclPortal.json b/application/Espo/Resources/metadata/app/aclPortal.json index 7ca873b030..82312340c5 100644 --- a/application/Espo/Resources/metadata/app/aclPortal.json +++ b/application/Espo/Resources/metadata/app/aclPortal.json @@ -60,6 +60,9 @@ }, "Meeting": { "reminders": false + }, + "Attachment": { + "parent": false } } }, diff --git a/frontend/client/src/views/fields/file.js b/frontend/client/src/views/fields/file.js index 1087c867f6..5b3f6d7a45 100644 --- a/frontend/client/src/views/fields/file.js +++ b/frontend/client/src/views/fields/file.js @@ -260,8 +260,6 @@ Espo.define('views/fields/file', 'views/fields/link', function (Dep) { attachment.set('type', fileParams.type || 'text/plain'); attachment.set('size', fileParams.size); attachment.set('role', 'Attachment'); - attachment.set('parentType', this.model.name); - attachment.set('parentId', this.model.id); attachment.once('sync', function () { if (!isCanceled) {