You need to sign in to do that
Don't have an account?
hyj
How to check whether a specified object (e.g. Account) is readable/editable for a user?
Hi all,
I've got a SFDC user sandbox and cuold login successfully with SOAP API.
When I get an object name, E.G. Account, how could I have a check whether I could read or edit its records before really having a try to read out a record or modify a record?
Any suggestion is expected.
Thanks
I've got a SFDC user sandbox and cuold login successfully with SOAP API.
When I get an object name, E.G. Account, how could I have a check whether I could read or edit its records before really having a try to read out a record or modify a record?
Any suggestion is expected.
Thanks
I do not see any other way than querying UserRecordAccess object at this moment.
If you are getting data/working in one user context you can just mark webservice class as 'with sharing' keywords to be sure that only accessible data will be returned, but in this case you do not know whether user can edit or delete a record.
Best Regards,
Lukasz
All Answers
You can query UserRecordAccess object: You can find more info here (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_userrecordaccess.htm).
Hope this helps,
Lukasz
It seems that it is required that the object UserRecordAccess could be accessed first.
Is there any way to get these informations for most (it is best to be all) users?
Thanks
I do not see any other way than querying UserRecordAccess object at this moment.
If you are getting data/working in one user context you can just mark webservice class as 'with sharing' keywords to be sure that only accessible data will be returned, but in this case you do not know whether user can edit or delete a record.
Best Regards,
Lukasz