Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

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.

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...