예제 #1
0
        public void SetHandlersAccessPolicy(ServerManager srvman, string fqPath, HandlerAccessPolicy policy)
        {
            var config = srvman.GetWebConfiguration(fqPath);
            //
            HandlersSection section = (HandlersSection)config.GetSection(Constants.HandlersSection, typeof(HandlersSection));

            //
            section.AccessPolicy = policy;
        }
예제 #2
0
        public HandlerAccessPolicy GetHandlersAccessPolicy(ServerManager srvman, string fqPath)
        {
            var config = srvman.GetWebConfiguration(fqPath);
            //
            HandlersSection section = (HandlersSection)config.GetSection(Constants.HandlersSection, typeof(HandlersSection));

            //
            return(section.AccessPolicy);
        }
 public void SetHandlersAccessPolicy(string fqPath, HandlerAccessPolicy policy)
 {
     //
     using (var srvman = GetServerManager())
     {
         var config = srvman.GetWebConfiguration(fqPath);
         //
         HandlersSection section = (HandlersSection)config.GetSection(Constants.HandlersSection, typeof(HandlersSection));
         //
         section.AccessPolicy = policy;
         //
         srvman.CommitChanges();
     }
 }