SHOW:
|
|
- or go back to the newest paste.
1 | //WCF CODE | |
2 | namespace SRS_WCF | |
3 | { | |
4 | [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] | |
5 | public class SRSService : ISRSService | |
6 | { | |
7 | public SRSService() | |
8 | { | |
9 | /* this line is crucial for PrincipalPermission to work */ | |
10 | Thread.CurrentPrincipal = HttpContext.Current.User; | |
11 | } | |
12 | ||
13 | [PrincipalPermission(SecurityAction.Demand, Authenticated = true)] | |
14 | - | public string Test() |
14 | + | public string Test() //Throws Error |
15 | { | |
16 | - | var head = HttpContext.Current.Request; |
16 | + | |
17 | } | |
18 | } | |
19 | } |