function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jan Kopejtko 2Jan Kopejtko 2 

Owner and Role Hierarchy

I need to restrict editation of a record this way:

Only owner or users above hierarchy can edit the record.

I know that validation rule can obtain NOT(user.id = owner.id), which makes sure that only the owner can edit the record, but how about the users above hierarchy?

I have OWD on public/read, that's. Can't use private OWDs.
Sunad RasaneSunad Rasane

Hi Jan,

You can create a new Sharing Rule-
Qwned by members of - Lower Level of roles or Roles and subordinates.
Share with - Upper Level of Role.

Please reply if this helps you. Also, don't forget to mark it as the best answer so it will help others.
Thanks

GauravGargGauravGarg
Hi Jan,

As you mentioned the OWD is public Read. To restrict the editing capability, you need to write Trigger Validation.

Thanks,
Gaurav