SecurityManager.PolicyHierarchy() : SecurityManager « System.Security « C# / C Sharp by API






SecurityManager.PolicyHierarchy()

  

using System;
using System.Security.Policy;
using System.Security;
using System.Collections;

class Class1 {
    static void Main() {
        IEnumerator PolicyEnum = SecurityManager.PolicyHierarchy();
        while (PolicyEnum.MoveNext()) {
            PolicyLevel levelPolicy = (PolicyLevel)PolicyEnum.Current;
            Console.WriteLine(levelPolicy.Label);
            IEnumerator PermissionEnum = levelPolicy.NamedPermissionSets.GetEnumerator();
            while (PermissionEnum.MoveNext()) {
                NamedPermissionSet permissionSet = (NamedPermissionSet)PermissionEnum.Current;
                Console.WriteLine("\tPermission Set: \n\t\t Name: {0} \n\t\t Description {1}", permissionSet.Name, permissionSet.Description);
            }
        }
    }
}

   
    
  








Related examples in the same category

1.SecurityManager.CheckExecutionRights
2.SecurityManager.SavePolicy()