Security scenario
At Kalos Pharma, users in the Medical group that have the CM_MedInfo_Agent role need to be able to edit CM_Custom_Response type documents that are in a Draft state.
To configure security to meet this requirement, follow the steps in these sections:
Step 1 - Configure the Document Sharing Rule
To configure a document sharing rule that applies to the Medical group:
Create a Document Sharing Rule.
In the Quick Find box in Setup, search for and select Custom Metadata Types.
In the Document Sharing Rule row, click Manage Records.
Click New.
For each field in the Information section, enter the Value listed in the table.
Field
Description
Value
Label
Document Sharing Rule label
MedInfo Type Documents RuleDocument Sharing Rule Name
API name for the Document Sharing Rule
MedInfo_Type_Documents_RuleDescription
Description of the Document Sharing Rule
if a document's type equals
CM_Custom_Response, theCM_MedInfo_Agentrole should be added to that document's Document Roles table.Role
Role associated to the Document Sharing Rule
CM_MedInfo_AgentCriteria
JSON criteria are used to determine whether a role(s) has access to a document.
{ "path": "documentVersion.mvn__CM_Document_Type__c", "operator": "Equals", "value": "CM_Custom_Response" }Active
Whether the Document Sharing Rule is active
YesClick Save.
Create a Document Sharing Rule Group. The Document Sharing Rule Group connects the
MedInfo_Type_Documents_Ruledocument sharing rule and theMedicalgroup.In the Quick Find box in Setup, search for and select Custom Metadata Types.
In the Document Sharing Rule Group row, click Manage Records.
Click New.
For each field in the Information section, enter the Value listed in the table.
Field
Description
Value
Label
Document Sharing Rule Group name
MedInfo Type Documents GroupDocument Sharing Rule Group Name
API name for the Document Sharing Rule Group
MedInfo_Type_Documents_GroupDocument Sharing Rule
Document Sharing Rule associated to the Document Sharing Rule Group
MedInfo_Type_Documents_RuleNote
This is the Document Sharing Rule created in the previous major step just created.
Group
The Group associated to the Document Sharing Rule Group
MedicalClick Save.
Step 2 - Configure the Permission
To enable the CM_MedInfo_Agent role to Edit Document in a Draft state:
Create a Document State Role that links the
Draftstate and theCM_MedInfo_Agentrole together.In the Quick Find box in Setup, search for and select Custom Metadata Types.
In the Document State Role row, click Manage Records.
Click New.
For each field in the Information section, enter the Value listed in the table.
Field
Description
Value
Label
Document State Role name
Draft - MedInfo AgentDocument State Role Name
API name for the Document State Role
Draft_MedInfo_AgentDocument State
Document State associated with this Document State Role
DraftRole
Role associated to this Document State Role
CM_MedInfo_AgentClick Save.
Create a Document State Role Permission that links the
Draft - MedInfo Agentdocument state role with theEdit Documentpermission.In the Quick Find box in Setup, search for and select Custom Metadata Types.
In the Document State Role Permission row, click Manage Records.
Click New.
For each field in the Information section, enter the Value listed in the table.
Field
Description
Value
Label
Document State Role Permission name
Draft - MedInfo Agent - Edit DocumentDocument State Role Permission Name
API name for the Document State Role Permission
Draft_MedInfo_Agent_Edit_DocumentDocument State Role
Document State Role associated to this Document State Role Permission
Draft - MedInfo AgentPermission
Permission associated to this Document State Role Permission
Edit DocumentClick Save.
Outcome
With the document sharing rule created and the Edit Document permission for the CM_MedInfo_Agent role configured, anytime a user adds a CM_Custom_Response type document to the environment, Regulated Content Cloud determines that the rule is True for the added document and inserts the CM_MedInfo_Agent role to the document's Document Roles table. Users in the Medical group with the CM_MedInfo_Agent role are then able to edit the document while the document is in a Draft state.