Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //WCF CODE
- namespace SRS_WCF
- {
- [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
- public class SRSService : ISRSService
- {
- public SRSService()
- {
- /* this line is crucial for PrincipalPermission to work */
- Thread.CurrentPrincipal = HttpContext.Current.User;
- }
- [PrincipalPermission(SecurityAction.Demand, Authenticated = true)]
- public string Test() //Throws Error
- {
- return "Hello";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement