Re: Require multiple role membership?

From: Arthur Dent (hitchhikersguideto-news_at_yahoo.com)
Date: 12/10/04


Date: Fri, 10 Dec 2004 10:59:58 -0500

Yeah, thats what im doing at the moment... i have my roles defined in an
enum, and as additional members of the enum i have my combined roles, then i
check those names (i use System.Enum.GetName() to define my role names). Eg.
Enum UserRoles
    Employee = 2
    Administrator = 4
    AdminEmployee = Employee Or Administrator
End Enum

Then in my allow role i add AdminEmployee.

I just thought maybe there was a way to do this without creating combinatory
values like that.
Thanks!

"Joe Kaplan (MVP - ADSI)" <joseph.e.kaplan@removethis.accenture.com> wrote
in message news:O9eOf%23s3EHA.2788@TK2MSFTNGP15.phx.gbl...
>I don't think you can do this via web.config. You could do this
>programmatically with IsInRole calls, but that is extra work.
>
> Another way around this might be to create "AND" roles when you do your
> role mapping, so that you have a special role like EmployeeANDAdminstrator
> that you could then use in web.config.
>
> HTH,
>
> Joe K.
>
> "Arthur Dent" <hitchhikersguideto-news@yahoo.com> wrote in message
> news:%23NgJ4Ks3EHA.404@TK2MSFTNGP10.phx.gbl...
>> Is there any way in the web.config "allow roles" authorization section,
>> to AND the roles together?
>> Eg. in my app, i have roles Customer, Employee, and Admininstrator. Now,
>> there could be Admin employees, and Admin Customers, each with access to
>> different sections.
>> Is there a way to specifiy that you can only get into the folder
>> "AppAdmin" if you are in role Employee AND role Administrator?
>> As ive seen it before, the roles by default only OR together.
>>
>> Thanks in advance,
>> - Arthur Dent
>>
>
>