First off, this refers to SSRS, but I'm pretty sure the underlying issue is with how my code works on the SharePoint server.
I'm using the following code in an SSRS report to check role membership.
- System.Threading.Thread.CurrentPrincipal.IsInRole("KLEINFELDER\Denver-Users")
It works just great when I deploy the report in native SSRS mode. When I deploy to our SharePoint server, this code doesn't seem to work. It doesn't appear that the IsInRole is looking at the AD Group membership correctly.
Should I be able to use the CurrentPrincipal.IsInRole() from within SharePoint? I've seen lots of code using HTTP Context and/or SharePoint context, but I'm not sure I can reference this in my SSRS report code. Or maybe I should be doing this?
I did enable the roleManager in web.config on both my WFE and App server using the following:
<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" />