Skip to main content

Document Roles

Document Roles (mvn__CM_Document_Role__c) manage the list of users or groups and their associated Role(s) for a document. Document Roles can be assigned manually via the Sharing tab of a document record or automatically through workflows. For a list of Document Role fields, visit Document Role.

Document Role assignment

Document Roles are assigned three ways:

  • Manually via the Sharing tab on a document record

  • Automatically via workflows

  • Automatically via Document Sharing Rules

Note

Document Roles cannot be assigned to inactive users, and the Document Roles assigned to users while they are active are removed from those users when they become inactive.

Manual assignment

To manually assign a Document Role:

Note

To manually share a document, you must have the Manage Sharing permission for that Document. Visit Document permissions.

  1. Navigate to the Sharing tab on a Document’s Detail Page.

  2. Click New.

  3. Search for and select a User or Document Group.

  4. Select a Role to assign to the User or Document Group.

  5. Click Save.

Automatic assignment via workflows

When users are assigned Workflow Activities, Komodo Publications Planning automatically adds those users to the Document Role according to the nature of the activity. For example, when a user is assigned a Task with the Record Type CM_General, Komodo Publications Planning assigns that user the “Reviewer” Document Role. When a user is assigned a Task with the Record Type CM_Approval, Komodo Publications Planning assigns that user the Approver Document Role. Visit Workflows.

Note

By default, Komodo Publications Planning does not automatically remove Document Roles when workflow tasks associated to the Role are closed. To enable strict document role assignments, set mvn__CM_Global_Setting__mdt.mvn__CM_Strict_Document_Roles__c to true.

Automatic assignment via Document Sharing Rules

With Document Sharing Rules, the criteria you set determines whether a role(s) has access to a document. Upon creation of a document, Komodo Publications Planning evaluates all Document Sharing Rules. If a Document Sharing Rule evaluates to true for the document, Komodo Publications Planning inserts the associated role(s) for that Document Sharing Rule into the document's Document Roles database table and grants associated groups access to the document. Groups are associated with Document Sharing Rules through Document Sharing Rule Groups. The Document Roles table determines what users can see and do as a document goes through its lifecycle. This means that when a document's state changes, the permissions for each Document Role are recalculated.

For more information, visit Document Sharing Rule Groups.

Recalculate sharing

You can use either the CM_DocumentSharingService or the CM_RecalculateSharingBatch class to recalculate sharing on documents in your environment. Sharing recalculation is performed by deleting CM_Document_Role_Share__c records and then recreating CM_Document_Role_Share__c records for a list of CM_Document_Role__c records.

To recalculate sharing:

  1. Open an Execute Anonymous Window. Visit Salesforce's documentation.

  2. In the Execute Anonymous Window, enter the code for one of these options:

    • Recalculate sharing for the a list of CM_Document_Role__c records:

      CM_DocumentSharingService.recalculateSharing(List<CM_Document_Role__c> documentRoles)
    • Recalculate sharing for a set of CM_Document__c record IDs:

      CM_DocumentSharingService.recalculateSharing(Set<Id> documentIds)
    • Recalculate sharing for all CM_Document__c records:

      Database.executeBatch(new mvn.CM_RecalculateSharingBatch(), <batch size>);
  3. Click Execute.

Document ownership

Only a single owner can be tied to a Document. Transferring Document ownership updates the CM_Owner role and updates the Salesforce Owner for the Document, Document Version, open and completed Workflows, and Document Relationship records owned by the previous owner.