Questions tagged [principalpermission]
33 questions
10
votes
1 answer
PrincipalPermission vs Authorize Attribute?
Can anybody explain to me the differences and use cases of these two attributes? I am quite confused since they behave similarly.
I know that the [Authorize] hooks into the ASP.NET application life cycle and run before the request reach to the…

Benjamin Nguyen
- 251
- 3
- 8
7
votes
3 answers
Unhandled exception not caught by either Global.asax error handler or custom IHttpModule error handler
I have one method of a class (DPCal_EventMove) that I want to limit access to using Roles. I have both a Global.asax.cs error handler and a custom IHttpModule error handler intended to catch unhandled exceptions and Server.Transfer them to…

Matt
- 2,339
- 1
- 21
- 37
6
votes
3 answers
Why is System.Environment.MachineName value uppercased?
My machine name is lowercased (i see that in Advanced system settings dialog, Computer Name tab) but System.Environment.MachineName reports it uppercased. Why is that? This is a real problem for me because from my tests PrincipalPermissionAttribute…

UserControl
- 14,766
- 20
- 100
- 187
4
votes
3 answers
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…

Frank Bell
- 139
- 1
- 7
3
votes
1 answer
ASP.Net Membership principalpermission issues
I'm running into an issue with the PrinciplePermissionAttribute causing exceptions. Any pages where I have the attribute on the Load method throw an exception immediately after initial login.

JBernard
- 31
- 2
3
votes
1 answer
Converting Declaractive PrincipalPermission to Programmatic .Demand
I currently have two roles like this:
[PrincipalPermission(SecurityAction.Demand,
Role="Domain\Admin")]
[PrincipalPermission(SecurityAction.Demand,
Role="Domain\AnotherRole")]
The problem is that this inherited code is specific to the…

NealWalters
- 17,197
- 42
- 141
- 251
3
votes
3 answers
SecurityManager.IsGranted() behaviour
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",…
MadViking
3
votes
1 answer
PrincipalPermission only works with some AD groups
The following works perfectly (DOMAIN\DEVELOPERS):
[PrincipalPermission(SecurityAction.Demand,Role="DEVELOPERS")]
public string Test()
{
return "Works..";
}
The user that runs is a member of this group, so "of course" it works. I have another…

Joacim
- 33
- 5
2
votes
2 answers
fine-grained permissions; PrincipalPermission - roles seperate from permissions;
I've been using PrincipalPermission for a while in wcf services.
[PrincipalPermission(SecurityAction.Demand, Role = SecurityRoles.CanManageUsers)]
Our roles are prefixed with: Can* and is how we achieve fine grained actions control with the built in…

Leblanc Meneses
- 3,001
- 1
- 23
- 26
2
votes
3 answers
Worker queue and user context
We have a worker queue that a user can add work to. When the worker item is added the context is the users (HttpContext). But its a background thread that polls the queue and executes the items one by one in order.
I cant just store the User because…

Anders
- 17,306
- 10
- 76
- 144
2
votes
2 answers
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…

Scott Salyer
- 2,165
- 7
- 45
- 82
1
vote
1 answer
WCF CustomRoleProvider and Principle Permissions
EDIT: I think that the issue may be related to the issue below as I'm also using SSL
PrincipalPermission.Demand() failing once WCF Service was moved to SSL
I'm working on a secure set of web services, I've implemented a CustomRoleProvider and…

Midimatt
- 1,114
- 2
- 17
- 35
1
vote
1 answer
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…

Scott Salyer
- 2,165
- 7
- 45
- 82
1
vote
2 answers
elevation demand not working for method in winforms app
I have a winforms app that installs other apps in a loop. This works properly on an administrator account in Windows 7, but I have serious issues in a standard account - the app requires elevation in order to write to "Program Files(x86)"…

Amc_rtty
- 3,662
- 11
- 48
- 73
1
vote
0 answers
PrincipalPermission.Demand() failing once WCF Service was moved to SSL
My Silverlight/WCF application uses PrincipalPermission in each service method to ensure the user is Authenticated. This works just fine when I have everything configured to HTTP, but once I configured my service endpoints/bindings to support HTTPS…

Scott
- 874
- 3
- 12
- 36