Note - I'm posting this question as there's clarity required - At what level does the record access need to open up for this scenario to be successful? This hasnt been clearly answered on the Community/StackExchange.
(Ref 1: StackExchange - You don't have permission to do this)
Role Hierarchy/Sharing Settings
We have a Role heirarchy as below :-
- -Super Admin
- --USA Admin
- ---USA Support
We have an Account Sharing Rule which has a 'Reseller' RecordType shared with USA Admin (Role and Internal Subordinates). Access to Account is R/W and Case is Private.
The access opens up on the Case Sharing Rules where all the RecordTypes are shared with USA Admin (Role and Internal Subordinates). Access to Case here is R/W
Scenario
- We have a Flow (which is invoked via Process Builder) that has a chatterPost Action which @mentions a Chatter Group to a Case. The CaseID is pass via Process Builder, alongwith Custom Metadatas for the Chatter Message and the MDT containing the (Chatter) Collaboration Group ID. This is triggered based on keywords/other conditions via the process decision box.
- The Chatter Groups are Public and Agents have access to post to them/@mention them on Cases.
- Success - If an Agent (USA Support role) creates a Case on a Account which he owns, the Process -> Flow works correctly and auto @mentions the Chatter Group with the Chatter Message.
- Failure - If the Agent creates a Case on an Account for a role above theirs (USA Admin/Super Admin), the Process/Flow fails with the error - 'You don't have permission to do this'
I know there are a few posts based on this issue (as referenced above), but here, the user/role has access to the Case and Chatter Group where the postToChatter action happens. Any idea how the access is being restricted/why this flowAction error is occuring?
Error Logs
How the Interview Started
Agent ABC (0050r000000lUoG) started the flow interview. Some of this flow's variables were set when the interview started. input_CaseRecordID = 5000r000002EKLvAAO input_ChatterGroupID_MDT = 0F90r000000087hCAA input_ChatterMessageDeveloperName_MDT = CC_Case_Chatter_Message
GET RECORDS: Lookup_the_Chatter_Setting_MDT Find one Chatter_Setting__mdt record where: DeveloperName Equals {!input_ChatterMessageDeveloperName_MDT} (CC_Case_Chatter_Message) Result Successfully found record. {!var_ChatterMessage} = This Case requires your attention. Please click 'Follow' to get regular updates for this Case. Once 'Closed', please 'Unfollow' the Case to stop receiving email notifications.
POST TO CHATTER: Post_to_Case_Record Inputs: text = {!tt_ChatterPostForCase} (@[0F90r000000087hCAA] - This Case requires your attention. Please click 'Follow' to get regular updates for this Case. Once 'Closed', please 'Unfollow' the Case to stop receiving email notifications.) subjectNameOrId = {!input_CaseRecordID} (5000r000002EKLvAAO)
Error Occurred: You don't have permission to do this.