I want to find out, if another user has READ permission on a specific object (I don't care about record access/sharing). Is there a way to accomplish this via APEX?
I do NOT want to find out if the running user has access to the object, since that is rather straight forward.
My use case is: I want to assign ownership of custom object records to users based on their properties. Unfortunately a user can only own a record if he has at least read access to the object. If I try to assign the owner regardless, I'll get an exception.
Also this must be applicable in a non-test context, so. runAs() won't do.
My question is: How can I check read (or CRUD in general) access to objects for other users?
Any help is appreciated.
Best Answer
You can try like below
Before assigning, chedk if that user has PermissoinsRead field is true.