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
Subrahmanyam KonathlapalliSubrahmanyam Konathlapalli 

Hi All,In visualforce page how to disable custom button for particular user

Deepali KulshresthaDeepali Kulshrestha
Hi Subrahmanyam,
To do what you're asking about you'd need to create a Dynamic Visualforce Component based on the $User.Profile:
Try the following code:
Component.Apex.OutputText renderButton = new Component.Apex.OutputText();
renderButton.expressions.value = 
    '{!IF($User.Profile == "NameofUserRequiredProfile", "True", "False")}';

Please refer to the following link :
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_dynamic_vf_components_implementation.htm

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha