mike55 Posted November 1, 2007 Posted November 1, 2007 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. Quote 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)
Administrators PlausiblyDamp Posted November 1, 2007 Administrators Posted November 1, 2007 IIRC the .Net membership and role providers only require SQL 2000 or higher - if the role provider would meet your needs you shouldn't need to use SQL 2005. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.