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 in 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, Medical Information Cloud Content Management 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, Medical Information Cloud Content Management assigns that user the “Reviewer” Document Role. When a user is assigned a Task with the Record Type CM_Approval, Medical Information Cloud Content Management 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, Medical Information Cloud Content Management evaluates all Document Sharing Rules. If a Document Sharing Rule evaluates to true for the document, Medical Information Cloud Content Management 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 class, the CM_RecalculateSharingBatch class, or the CM_CreateDocumentSharingRulesBatch 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. Both existing and new sharing rules will be applied.

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 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 without accounting for groups::

      Database.executeBatch(new mvn.CM_RecalculateSharingBatch(), <batch size>);
    • Recalculate sharing for all CM_Document__c records while taking into account of groups. For more information about document sharing rules for groups, reference Document Sharing Rule Groups.

      Database.executeBatch(new CM_CreateDocumentSharingRulesBatch());
  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.