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
DesaiDesai 

limit the visibility of the button based on Roles

Hi,

Is it possible to limit the visibility of the button based on Roles ?

Thanks.
bilal malikbilal malik
In visualforce page, you can simply query the logged in user'e role .
select Id, Name, UserRole.Name  from User

Also, use visibility variable to control button visibility.

if( role == 'Analyst)
       visibility = true;

and in visualforce page, you can use rendered property in button like rendered = "{!visibility}".

Mark this as best answer if it helped you out.

Thanks!!
Bilal