PrincipalPermission Problem in ASP.NET
From: Dominick Baier (dotnet_at_leastprivilege.com)
Date: 12/28/04
- Previous message: Tripper: "PrincipalPermission Problem in ASP.NET"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
To: microsoft.public.dotnet.security Date: Tue, 28 Dec 2004 11:07:07 -0800
try Thread.CurrentPrincipal = gp (IIRC works only intra-page - if you want to set the principal in AuthenticateRequest you have to user Context.User)
---
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Every time I run the below code, I always get a Security Exception.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim gi As New GenericIdentity("JoeUser")
Dim gp As New GenericPrincipal(gi, New String() {"Admin"})
HttpContext.Current.User = gp
ProtectedFunction()
End Sub
Private Sub ProtectedFunction()
Dim pp As New PrincipalPermission("JoeUser", "Admin")
pp.Demand()
End Sub
Does anyone know what I'm doing wrong or if I need to change a setting in
web.config.
Thanks
[microsoft.public.dotnet.security]
- Previous message: Tripper: "PrincipalPermission Problem in ASP.NET"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|