How can we check whether an user has object accessibility on visualforce page?

How can we check whether an user has object accessibility on visualforce page?

To check whether an object has accessibility on visualforce page, use the below code

{!$ObjectType.MyCustomObject__c.accessible}

It returns true or false.

Sample code:

<apex:page >
    Accessibility for Object ‘Member__c’ is {!$ObjectType.Member__c.accessible}
</apex:page>  

Output:







Cheers!!!

Leave a Reply