P
perplexed
I'm familiar with membership/roles in ASP.NET 2.0. Rather than the
more common directory restriction, I need page part restrictions.
There are certain parts of my webpages that I need visible if you are
in a particular role. So maybe the "go to billing" button is only
visible if you are in "plan1" role. What is the correct method/model
to implement that type of role restriction?
Will I need to put in a conditional for each component that needs
displays dependent on a role:
if (Roles.IsUserInRole("plan1"))
//display button
else
//don't display button
The problem with the above code is that it won't scale very well. I
may in the future want to add "plan2" to the above. So anyone is plan1
or plan2 sees the button. Plan3 doesn't however. I'd have to go find
all of the conditionals that need plan2 and update them. Is there a
better way?
Thanks,
Brett
more common directory restriction, I need page part restrictions.
There are certain parts of my webpages that I need visible if you are
in a particular role. So maybe the "go to billing" button is only
visible if you are in "plan1" role. What is the correct method/model
to implement that type of role restriction?
Will I need to put in a conditional for each component that needs
displays dependent on a role:
if (Roles.IsUserInRole("plan1"))
//display button
else
//don't display button
The problem with the above code is that it won't scale very well. I
may in the future want to add "plan2" to the above. So anyone is plan1
or plan2 sees the button. Plan3 doesn't however. I'd have to go find
all of the conditionals that need plan2 and update them. Is there a
better way?
Thanks,
Brett