You need to sign in to do that
Don't have an account?
Pooja Shah
allow user to view the contract only if he is higher up in the role heirarchy
In a visual force page, I want to make a section of the page visible to only those people who are higher in the role heirarchy than the person who has created.
How can I can achieve the same?
Thanks in advance,
Pooja
How can I can achieve the same?
Thanks in advance,
Pooja
It is definitely not the best idea ever, requires hard coding data, doesn't scale well, depending on number of roles would take a while to set up, is probably the worst advice I've given on these boards, but just might work. Hows that for a disclaimer?
You could create a map that contains the Id (key) of every user role and then a number(value). The highest role would return the number 1 and then working down the hierarchy you would add 2, 3, 4 etc for the different role levels. Then based on the UserRole and OwnerRole you can see which is higher and then determine what components on the page could be rendered.
But of course your map will break when ever a new Role is created or the hierarchy is reordered.
It would be cool if salesforce.com automatically calculated this "index" integer and it was a field on the UserRole object.
Message Edited by TehNrd on 06-18-2008 05:01 PM