Security.Roles.IsUserInRole --> Security Exception

Topics: General Topic
Jun 11, 2013 at 9:20 AM
Hello, It's me again ^^

I have another problem when I use :
System.Web.Security.Roles.IsUserInRole(username, rolename)
When username is me, it works.
When it's someone else, I have this error message :
Security Exception 
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. 

Exception Details: System.Security.SecurityException: Fonction incorrecte.
Stack Trace: 


[SecurityException: Fonction incorrecte.
]
   System.Security.Principal.WindowsIdentity.KerbS4ULogon(String upn) +2176723
   System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName, String type) +61
   System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName) +38
   NetSqlAzMan.Providers.NetSqlAzManRoleProvider.IsUserInRole(String username, String roleName) +497
   System.Web.Security.Roles.IsUserInRole(String username, String roleName) +398
   TEST.FormTest.FCT_USER_IN_ROLE(String username, String roleName) in C:\cedric\TEST\TEST\FormTest.aspx.cs:207
   TEST.FormTest.BTN_VALIDER_Click(Object sender, EventArgs e) in C:\cedric\TEST\TEST\FormTest.aspx.cs:96
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
   System.Web.UI.Page.ProcessRequest() +80
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.gestionnouveauvalideur_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\68d56fcc\a1189775\App_Web_9bao5uc8.3.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
I try add this code in my web.config but no change :
    <securityPolicy>
      <trustLevel name="Full" policyFile="internal"/>
    </securityPolicy>
Thanx you
Dewey