示例#1
0
        public void TestACLEveryoneRetreive()
        {
            ACL acl = new ACL();

            acl.Add(new ACLEveryoneAllowRetrieve());
            acl.Check(new ManagedSecurityContext(new Account()), DataOperation.Retreive);
        }
示例#2
0
 public void TestBlankACLValidAccount()
 {
     ACL acl = new ACL();
     Account account = new Account();
     acl.Add(new ACLAccount(account, DataOperation.All));
     acl.Check(new ManagedSecurityContext(account), DataOperation.Create);
 }
示例#3
0
        public void TestBlankACLInvalidAccount()
        {
            ACL acl = new ACL();

            acl.Add(new ACLAccount(new Account(), DataOperation.All));
            acl.Check(new ManagedSecurityContext((Account)null), DataOperation.Create);
        }
示例#4
0
        public void TestBlankACLValidAccount()
        {
            ACL     acl     = new ACL();
            Account account = new Account();

            acl.Add(new ACLAccount(account, DataOperation.All));
            acl.Check(new ManagedSecurityContext(account), DataOperation.Create);
        }
示例#5
0
        public void TestAdminACL()
        {
            // make sure that the administrative ACL is a cloned fresh copy
            // (so that more ACLs can be added)
            ACL acl    = ACL.GetAdministrativeACL(Session);
            int count1 = acl.Count;

            acl.Add(new ACLAuthenticatedAllowCreate());
            ACL acl2 = ACL.GetAdministrativeACL(Session);

            Assert.AreNotEqual(acl, acl2);
            Assert.AreEqual(count1, acl2.Count);
        }
示例#6
0
        public IChannelACLEntry CreateACLEntry(IChannelGroup targetGroup)
        {
            var x = new ChanACL
            {
                ApplyOnSubchannels = true,
                ApplyOnThisChannel = true,
                Allow       = (ChannelPermissions)0,
                Deny        = (ChannelPermissions)0,
                TargetGroup = targetGroup,
            };

            ACL.Add(x);
            return(x);
        }
示例#7
0
 public void TestACLEveryoneRetreive()
 {
     ACL acl = new ACL();
     acl.Add(new ACLEveryoneAllowRetrieve());
     acl.Check(new ManagedSecurityContext(new Account()), DataOperation.Retreive);
 }
示例#8
0
 public void TestBlankACLInvalidAccount()
 {
     ACL acl = new ACL();
     acl.Add(new ACLAccount(new Account(), DataOperation.All));
     acl.Check(new ManagedSecurityContext((Account) null), DataOperation.Create);
 }