I don't understand your issue. With the method you have, and the 2 I
suggested (via the URL), then you have control
private readonly string ROLE_PLAN1 = "plan1";
private readonly string ROLE_PLAN2 = "plan2";
private readonly string ROLE_PLAN3 = "plan3";
this.button1.vi sible = Roles.IsUserInR ole ( ROLE_PLAN1 );
this.button2.vi sible = Roles.IsUserInR ole ( ROLE_PLAN2 );
this.button3.vi sible = Roles.IsUserInR ole ( ROLE_PLAN3 );
this button12.visibl e = Roles.IsInAnyRo le ( new string[] { ROLE_PLAN1 ,
ROLE_PLAN2 } ) ;
this button13.visibl e = Roles.IsInAnyRo le ( new string[] { ROLE_PLAN1 ,
ROLE_PLAN3 } ) ;
this.supersecre tbutton.visible = Roles.IsInAllRo les ( new string[] {
ROLE_PLAN1 , ROLE_PLAN2 , ROLE_PLAN3 } ) ;
...
If you need runtime ability to add buttons via roles, that's a different
issue. Doable, but more involved.
Someone correct me if I'm wrong, but there isn't any magic fairy dust, if
you have a button, and it depends on a role, somewhere you have to set the
visible property against a role/set of roles.
The 3 methods should cover the now and future needs as you add more roles.
"perplexed" <jo***@bigstrin g.comwrote in message
news:11******** **************@ v45g2000cwv.goo glegroups.com.. .
Thanks but what I really need is more fine grain control. If there are
three roles and content on one page is dependent on different roles,
that means I'll need three "different" checks. The method you have
will display all three pieces of content regardless of a "particular "
role. So on one page it may look like this:
if (Roles.IsUserIn Role("plan1"))
//display button1
else
//don't display button1
if (Roles.IsUserIn Role("plan2"))
//display button2
else
//don't display button2
if (Roles.IsUserIn Role("plan3"))
//display button3
else
//don't display button3