+ Start a Discussion

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.