Activity Forums Salesforce® Discussions How can I find out if the current user has access to a Salesforce record, if it has permissions or not?

  • Mohit

    Member
    September 7, 2016 at 6:05 am

    Hi Pranav,

    You can check the accessibility of the user by SOQL in this way:-

    SELECT RecordId, HasEditAccess FROM UserRecordAccess WHERE UserId = [single ID] AND RecordId = [single ID]

    And without Soql you check the accessibility of user:-

    On Visualforce Page:-

    {!$ObjectType.Account.accessible}

    On Apex Page :-

    Schema.DescribeSObjectResult accountDescribe = Account.sObjectType.getDescribe();
    System.debug('accessible:' + accountDescribe.accessible);

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos