Exemplo n.º 1
0
        public void CanQueryAcls()
        {
            HttpAPIManager manager = new HttpAPIManager();
            var            testUrl = "http://+:9399/CanQueryAclsTest";

            manager.SetUrlAcl(testUrl, SecurityDescriptor.FromSDDL("D:(A;;;;;WD)"));
            try
            {
                var containsTemporaryUrl = manager.GetAclInfo().Any(url => url.Prefix.Contains("CanQueryAclsTest"));
                Assert.True(containsTemporaryUrl, "You should be able to retrieve Acls");
            }
            finally
            {
                manager.RemoveUrlAcl(testUrl);
            }
        }
Exemplo n.º 2
0
        public void CanAddAndRemoveAcl()
        {
            var            testUrl = "http://+:9393/";
            HttpAPIManager manager = new HttpAPIManager();

            manager.SetUrlAcl(testUrl, SecurityDescriptor.FromSDDL("D:(A;;GX;;;WD)"));
            try
            {
                var acl = manager.GetAclInfo(testUrl);
                Assert.NotNull(acl);
                var fakeAcl = manager.GetAclInfo("unknown");
                Assert.Null(fakeAcl);
            }
            finally
            {
                manager.RemoveUrlAcl(testUrl);
            }
            var oldAcl = manager.GetAclInfo(testUrl);

            Assert.Null(oldAcl);
        }
Exemplo n.º 3
0
        public void Dispose()
        {
            HttpAPIManager manager = new HttpAPIManager();

            manager.RemoveUrlAcl(_Url);
        }