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
prathyu kattaprathyu katta 

how can i know that particular login user has object field access(read/write) permission or not?using coding.

field level access
Best Answer chosen by prathyu katta
{tushar-sharma}{tushar-sharma}
If you are using it for other purposes then you can use DescribeObjectResult and DescribeFieldResult to check the access. If you are looking to check for SOQL or DML then I suggest you check

Accessibility Check In SOQL Queries Using WITH SECURITY_ENFORCED: https://newstechnologystuff.com/2019/07/06/accessibility-check-in-soql-queries-using-with-security_enforced/

Enforce Security With the stripInaccessible Method: https://newstechnologystuff.com/2020/04/08/enforce-security-with-the-stripinaccessible-method/​​​​​​​

If this answer helps you, please mark it as accepted.

Regards,
Tushar Sharma

All Answers

ANUTEJANUTEJ (Salesforce Developers) 
Hi Prathyu,

I was searching for the above way but unfortunately, I was not able to get the field level security for a particular individual but however, I was able to find the below link which states a soql query for field-level security for a profile can you please have a look at it once.

>> https://salesforce.stackexchange.com/questions/71418/soql-statement-to-query-field-level-security-on-particular-profiles

In case if this came in handy can you please choose this as the best answer so that it can be useful for others in the future.

Regards,
Anutej
Deviprasad Hegde 30Deviprasad Hegde 30
You could use the describe functionaluty to check if the current user has the access to create /edit etc .
For example "Schema.sObjectType.Contact.fields.Status__c.isUpdateable())"

Follow this link 
https://developer.salesforce.com/page/Enforcing_CRUD_and_FLS
{tushar-sharma}{tushar-sharma}
If you are using it for other purposes then you can use DescribeObjectResult and DescribeFieldResult to check the access. If you are looking to check for SOQL or DML then I suggest you check

Accessibility Check In SOQL Queries Using WITH SECURITY_ENFORCED: https://newstechnologystuff.com/2019/07/06/accessibility-check-in-soql-queries-using-with-security_enforced/

Enforce Security With the stripInaccessible Method: https://newstechnologystuff.com/2020/04/08/enforce-security-with-the-stripinaccessible-method/​​​​​​​

If this answer helps you, please mark it as accepted.

Regards,
Tushar Sharma
This was selected as the best answer
Nicole NelsonNicole Nelson
Hi! Anctually i had the same problem, but i have found top article (https://expert-writers.net/) in the web blog, which really helped me! So maybe you will have a wish to read it too.