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
dnakonidnakoni 

Check individual record CRUD permissions in apex

Hey guys,

 

Is there a way to check (in apex) whether the current user has an Edit access to a particular Account record?

 

If there's not, I was thinking about creating a database savepoint, updating the record, catching the DML exception (if any), and then performing a rollback.

 

 

Andy BoettcherAndy Boettcher

You can query sharing permissions or designate the "with sharing" class definition through native APEX - but you can hit the CRUD permissions via the API.

 

-Andy