principalpermission

SecurityManager.IsGranted() behaviour

Hi, can anybody please explain the following c# behaviour? I have written a small console application just to learn about CAS, but I can not seem to understand why the following lines of code work like they do: string[] myRoles = new string[] { "role1", "role2", "role3" }; GenericIdentity myIdentity = new GenericIdentity("myUsername", ...

WCF and PrincipalPermission

I have a number of services that will be running under the security context of NT Authority\System as a Windows service (the services are NetTCP-based). There are six groups stored in Active Directory that will be allowed to access these services: Users Agents Approvers Administrators (three levels of admins) I know I can get the user ...

Active Directory and PrincipalPermission

This is more of a curiosity than a request for help, but I noticed that when using PrincipalPermission and verifying a user is part of a specific group in Active Directory it will not use the true group name but instead validates against the pre-Windows 2000 group name instead. Ordinarily this wouldn't make a difference - unless someone ...

Flowing WCF Role-Based Security through to UI

I am looking for some best practices on how to handle the following scenario - flowing permissions from WCF service layer through to UI: I have WCF services with methods that have been decorated with the PrincipalPermission attribute. I would like a means to allow a client to check if they have the required permissions before invoking t...

System.Security.SecurityException - Get the role name

Hi, I've implemented a catch all security exceptions method in my global.asax like this... protected void Application_Error(object sender, EventArgs e) { Exception err = Server.GetLastError(); if (err is System.Security.SecurityException) Response.Redirect("~/Error/Roles.aspx); } Is there a property I can access that shows...

Caller identity (Network Service account) obtained by WCF service is out of date

We have a WCF service using TCP binding, hosted in a Windows service. The WCF service is called by an ASP.NET web application. When the WCF service is called, I would like to check whether the calling identity is a member of a particular local group. A few ways to do this are: [PrincipalPermission(SecurityAction.Demand, Authenticated =...

PrincipalPermission - roles seperate from permissions

I've been using PrincipalPermission for a while in wcf services. [PrincipalPermission(SecurityAction.Demand, Role = SecurityRoles.CanManageUsers)] although now i have a requirement to simplify roles by business unit. - currently aspnet_roles has fine grained can* permissions. Here is my approach and wanted to see if anyone can provide ...

Role Based Authorization in .NET with PrincipalPermission and SecurityAction.Assert

I have a class attributed with [PrincipalPermission(SecurityAction.Demand, Authenticated = true)] public class MyProtectedClass { } This works as expected and callers are denied access when the current principal is not authenticated. In one specific scenario, I want this logic short-circuited...that is, the caller should not need to...

Principal Permission

I worte a method with PrincipalPermissionAttrubute then i run this method but i get an exception - security exception. It happen cause i dont know who is the principal that running. I try to get the current principal by Thread.GetCurrntPrincipal() but i have a casting problem. My question is how i know the principal who running and...