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
salesforce_deversalesforce_dever 

Display HTML based on a user's Permission Sets

Hello all,

 

Hopefully this is an easy question.

 

Is it possible to conditionally show elements based on a user's permission sets?

 

Basically, I need a way to say... "Hey visualforce page, if the current user has this permission set then they can view this section of this page. Groovy visualforce. You're actually doing it. Bangarang VisualForce. Bangarang."

 

Is there a way to do this without using a controller?

 

Any help would be greatly appreciated.

 

Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
florianhoehnflorianhoehn

Hi,

 

You can only use the Global Variables in VF pages without any controller. Unfortunately it looks like permission sets are not in there (yet). Maybe you can use the profile of the user instead?

 

Hope this helps!

 

Florian

All Answers

florianhoehnflorianhoehn

Hi,

 

You can only use the Global Variables in VF pages without any controller. Unfortunately it looks like permission sets are not in there (yet). Maybe you can use the profile of the user instead?

 

Hope this helps!

 

Florian

This was selected as the best answer
salesforce_deversalesforce_dever

I was afraid of that.

 

I can definitely use the user's profile for right now but later on down the road that is going to get a bit ugly and clunky.

 

Ah well, thanks for the quick response!

florianhoehnflorianhoehn

If you are lucky SF will add the permission sets to the global variables. Might even be a idea out there already worth voting for..