Announcement

Collapse
No announcement yet.

Portals and Documents Permissions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Portals and Documents Permissions

    Hi,

    we're using EspoCRM because we needed a simple and effective customer portal in order to share some documents and data.
    Some of these documents have to be visible to specific customers, and that can be quickly managed by linking documents to accounts and setting Portal Users permissions to account. However, we'd like for some documents (and/or document folders) to be visible to everyone, is there a way to do that without having to link a document to every account each time?

    PS: maybe KB articles can be used as a sort of "shared" document folder?

    Thanks
    Last edited by camazza; 12-06-2023, 09:25 AM.

  • #2
    Hi camazza,

    As a workaround, you can make the following automation:
    1. Create an account called “Document Sharing”, copy its ID.
    2. Link this account to all portal users.
    3. Go to Administration > Entity Manager > Document > Fields and create a field with Boolean type and Is Shared (isShared) name.
    4. Go to Administration > Entity Manager > Document > Layouts and transfer this field to the Detail and Detail (Small) layouts.
    4. Go to Administration > Entity Manager > Document > Formula > Before Save Custom Script and insert the following formula script:​
    Code:
    if ((entity\isNew() || entity\isAttributeChanged('isShared')) && isShared) {
       record\relate('Document', id, 'accounts', ' ') // insert your "Document Sharing" account ID into brackets
    }
    
    if (entity\isAttributeChanged('isShared') && !isShared) {
       record\unrelate('Document', id, 'accounts', ' ') // insert your "Document Sharing" account ID into brackets
    }


    Thus, after checking the box in the Is Shared field, the previously created "Document Sharing" account will be linked to the document and portal users will be able to have general access to it. When the checkbox is unchecked, the account will be unlinked from the document and access will be limited.

    Comment

    Working...
    X