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
Vinay ChaturvediVinay Chaturvedi 

Access permission control for inline vf pages on page layout

I have two inline VF Pages on a page layout.My requirement is that i want to control the visibilty or access to those inline VF pages on the basisi of a set of users.
Means,only a set of users should see one inline VF page and others should see only the second one and not the first one.
Can anyone please suggest any solution
SarfarajSarfaraj
1. Create two vf pages and add them to the page layout. Create two profile each having access to each vf. Assign your two sets of user to each of this profile. You may use permission set in place of profile depending on your requirement. 
It will work as per your requirement. User will see a message in place of the vf that he does not have permission to view it.
2. Create One vf page and generate different content based on profile of current user.

Dev.AshishDev.Ashish
In each of the vf page put eveything in outputPanel and render output panel according to user profiles.
For example if you want to show first vf page to Sales user profile user do this.
............
apex:outputPanel id="thePanel" rendered="{!$Profile.Name == 'Sales User'}">
............
now if you want to show second vf page to Marketing User profile user do this.

............
apex:outputPanel id="thePanel" rendered="{!$Profile.Name == 'Marketing User'}">
,,,,,,,,,,,,
Vinay ChaturvediVinay Chaturvedi
Hi Dev,
Thanku for the approach,I still haev one more doubt ..when i am trying to hide one output panel via rendered,the blank space is still visible in the layout,is there anyway that the blank space doesnt occur
Dev.AshishDev.Ashish
you can use pageblocksection instead output panel... try it.