You need to sign in to do that
Don't have an account?

question about visualforce sharing
This is one of the exam qns I have seen around that I don't agree with the answers I have seen:
A developer needs to create a visualforce page that displays case data. The page will be used by both support reps and support managers. The support rep profile does not allow visibility of the customer_Satisfaction_c Field, but the support manager profile does. How can the developer create the page to enforce field level security and keep future maintenance to a minimum?
A. Create one visualforce page for use by both profiles
B. Use a custom controller that has the with sharing keywords
C. Use a new support manager permission sets
D. Create a separate visualforce page for each profile
Now everywhere the answer suggested is B. But I am wondering why it is not A? By deafault the standard controller will impose user level sharing (rather than custom's system level sharing). This would also need less maintenance because there is no need to create an extension (with the 'sharing' keyword).
Can someone explain why it can't be A? or confirm it is A? (ofcourse B will also work but it is extra development that, IMHO, is not needed)
A developer needs to create a visualforce page that displays case data. The page will be used by both support reps and support managers. The support rep profile does not allow visibility of the customer_Satisfaction_c Field, but the support manager profile does. How can the developer create the page to enforce field level security and keep future maintenance to a minimum?
A. Create one visualforce page for use by both profiles
B. Use a custom controller that has the with sharing keywords
C. Use a new support manager permission sets
D. Create a separate visualforce page for each profile
Now everywhere the answer suggested is B. But I am wondering why it is not A? By deafault the standard controller will impose user level sharing (rather than custom's system level sharing). This would also need less maintenance because there is no need to create an extension (with the 'sharing' keyword).
Can someone explain why it can't be A? or confirm it is A? (ofcourse B will also work but it is extra development that, IMHO, is not needed)
I see option A works well.
We can use rendered attribute on the VF page custom field.
Based on profile type check in rendered attribute we can make field visible or not.
Hope this helps!!
To restrict a profile so that a particular field is not visible to it, we can just change the Field Level security settings for a particular object in profile.
By using these permission sets the developer will create a visual force page that displays case data and the page will be used by both support reps and support managers.
I agree with Option A.
as per my undestanding "With Sharing" keyword can impact data visibility and nothing to do with field visibility.