An imperative role-based security demand for the current principal to represent an identity with the name Anya AND be a member of the Managers role : Permissions : Security C# Examples


C# Examples » Security » Permissions »

 

An imperative role-based security demand for the current principal to represent an identity with the name Anya AND be a member of the Managers role









    
using  System;
using  System.Security.Permissions;

class  MainClass
{
        public  static  void  MyMethod()  
        {  
  
                PrincipalPermission  perm  =  new  PrincipalPermission(@"MACHINE\Joe",  @"MACHINE\Managers");
                        
                perm.Demand();
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Security
» Permissions