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
Nishant Dubey 7Nishant Dubey 7 

if we don't have access to custom object possible to create a visualforce page for same custom object with own logic

SandhyaSandhya (Salesforce Developers) 
Hi,

If a user has insufficient privileges to view an object, any Visualforce page that uses a controller to render that object will be inaccessible. To avoid this error, you should ensure that your Visualforce components will only render if a user has access to the object associated with the controller.

You can check for the accessibility of an object like this:
{!$ObjectType.objectname.accessible}

This expression returns a true or false value.
For example, to check if you have access to the standard Lead object, use the following code:
{!$ObjectType.Lead.accessible}

For custom objects, the code is similar:
{!$ObjectType.MyCustomObject__c.accessible}

where MyCustomObject__c is the name of your custom object.
 
<apex:page standardController="Lead">
<apex:pageBlock rendered="{!$ObjectType.Lead.accessible}">
<p>This text will display if you can see the Lead object.</p>
</apex:pageBlock>
<apex:pageBlock rendered="NOT({!$ObjectType.Lead.accessible})">
<p>Sorry, but you cannot see the data because you do not have access to the Lead object.</p>
</apex:pageBlock>
</apex:page>
Hope this helps you!

Please mark it as BestAnswer if my reply was helpful.

Thanks and Regards
Sandhya