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
kminevkminev 

Override security with apex code

HI,

 

I have my data sharing setup so people are not able to edit records after it has been approved and locked down. Now I need to wrtie an exception to people who pertain to a particular profile that can edit specific fields on this record ragardless on how the permessions are set up.

 

Is there a way this can be done with Apex code? Perahps use before update triggere and if user = "right role/profile" allow to edit fields 1,2,3....

 

Thank you.

Ispita_NavatarIspita_Navatar

Corresponding to each object we have a related ObjectNameShare object which stores information about sharing.

Adding an instance to this object add sharing and deletion of an instance of this object remove a particular sharing. Perhaps manipulation of this object would help you override security via apex code.