-3

I have 2 roles (Manager and Employee). Employee reports to Manager. Employees should be able to edit Case records created by manager. OWD on the Case object is Private.

Created a criteria based sharing rule based on Case Record Type to allow all users (with above 2 roles) other than the Owner to EDIT the record. Manager and Employee have different profiles and they have VIEW ALL Permission on Case in Profile. I thought sharing rule would work but it is not working. I think I have to create Apex sharing rule to share records?

Sharing rule is working for the records created by the employees. Managers are able to edit them but the vice versa is not working.

Manual sharing would not meet the expectations of the requirement.

Please advise.

  • 6
    Please do not SHOUT, as that is considered rude. Also, how are we supposed to know how to fix your problem when we have no details about the situation. What does the rule look like? What criteria does it have? Whom does it share records with? What research have you done on this topic? – sfdcfox Jun 28 at 17:27
  • Thank You @sfdcfox for your response.I have 2 roles (Manager and Employee). Employee reports to manager. Employees should be able to edit CaSe records created by manager. OWD on the Case object is Private. Created a criteria based sharing rule based on Case Record type to allow all users(with above 2 roles) other than the Owner to EDIT the record. Manager and Employee have different profiles and they have VIEW ALL Permission on case in Profile. I thought sharing rule would work but it is not working. I think I have to create apex sharing rule to share records?? Would this help.? – Ram Gunnam Jun 28 at 18:28
  • @sfdcfox. One more thing to add. Sharing rule is working for the records created by the employees. Managers are able to edit them but the vice versa is not working. – Ram Gunnam Jun 28 at 18:33
  • @RamGunnam Please edit your question to add this information for the community. – David Reed Jun 28 at 20:32
1

Your security architecture as described really does not make sense to me. As described, you might as well set the Org-Wide Default to Public, since that seems to be essentially what your sharing rule does. If your users have View All permission on the Case object, you certainly should just change the OWD to Public Read Only.

I suspect the real objective is something like this:

  • Managers should be able to edit the records owned by the Employees who report to them (but not the Employees who don't report to them).
  • Employees should be able to edit the records owned by their Manager (but not the other Managers, or other Employees).

Neither the Role Hierarchy nor Sharing Rule described will achieve this.

Access rolls up the Role Hierarchy, not the Reporting Hierarchy. This means that all users in the Manager role, which is above the Employee role, will have access to the records for all Employees.

Similarly, if you share Manager-owned records to Employees, all Employees will get access to the records of all Managers.

It's not clear what Record Types have to do with anything.

I see a couple of options here:

  1. Just set your Org-Wide Default to Read-Write, since you're most of the way there already.
  2. Divide your role hierarchy according to each sector that needs to roll up differently - i.e., Manager A -> Employee A, Manager B -> Employee B, and so for. Create one Sharing Rule for each grouping to share records owned by the Manager role to their corresponding Employee role. This will get unmaintainable depending on the scale.
  3. Use Apex-Managed Manual Sharing, since Apex Sharing per se is not available on standard objects. Last resort; it's tricky and harder to maintain and can be altered by users.

All of this assumes that users have Edit permission on the Case object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.