I am using Windows authentication, with authorization set to deny users="?"
I have set up three folders within my application, Admin, Staff, and All. I will have two roles, "admin" and "staff". The idea that I have is to prevent "admin" users from the Staff folder, and "staff" users from the Admin folder and that both "admin" and "staff" would have access to the All folder.
My problem is that I am unable to assign a custom role to individual windows users. I have tried to use the following code:
However, it seems to only apply to the current page that I am on.
I am not allowed to use the auto role mechanism that comes with visual studio .net as I have to use a SQL Server 2000 database. Any suggestions?
Mike55.
I have set up three folders within my application, Admin, Staff, and All. I will have two roles, "admin" and "staff". The idea that I have is to prevent "admin" users from the Staff folder, and "staff" users from the Admin folder and that both "admin" and "staff" would have access to the All folder.
My problem is that I am unable to assign a custom role to individual windows users. I have tried to use the following code:
Code:
Dim userIdentity As GenericIdentity = New GenericIdentity(HttpContext.Current.User.Identity.Name)
Dim roles() As String = New String() {"admin"}
Dim user As New GenericPrincipal(CType(userIdentity, IIdentity), roles)
However, it seems to only apply to the current page that I am on.
I am not allowed to use the auto role mechanism that comes with visual studio .net as I have to use a SQL Server 2000 database. Any suggestions?
Mike55.