Exemple #1
0
        public void GetStateCombinationsTest()
        {
            SecurableClassDefinition classDefinition = TestHelper.CreateOrderClassDefinition();
            var aclExpansionEntry = new AclExpansionEntry(User, Role, Acl, new AclExpansionAccessConditions(), AccessTypeDefinitions, AccessTypeDefinitions2);
            var result            = aclExpansionEntry.GetStateCombinations();

            Assert.That(result, Is.EqualTo(Acl.StateCombinations));
        }
Exemple #2
0
        public void StateCombinationsForStatelessAclThrowsTest()
        {
            SecurableClassDefinition classDefinition = TestHelper.CreateOrderClassDefinition();
            var statlessAcl = TestHelper.CreateStatelessAcl(classDefinition);

            var accessConditions  = new AclExpansionAccessConditions();
            var aclExpansionEntry = new AclExpansionEntry(User, Role, statlessAcl, accessConditions, AccessTypeDefinitions, AccessTypeDefinitions2);

            Dev.Null = aclExpansionEntry.GetStateCombinations();
        }
Exemple #3
0
        public void CtorTest()
        {
            var accessConditions  = new AclExpansionAccessConditions();
            var aclExpansionEntry = new AclExpansionEntry(User, Role, Acl, accessConditions, AccessTypeDefinitions, AccessTypeDefinitions2);

            Assert.That(aclExpansionEntry.User, Is.EqualTo(User));
            Assert.That(aclExpansionEntry.Role, Is.EqualTo(Role));
            Assert.That(aclExpansionEntry.Class, Is.EqualTo(Acl.Class));
            Assert.That(aclExpansionEntry.GetStateCombinations(), Is.EqualTo(Acl.StateCombinations));
            Assert.That(aclExpansionEntry.AccessConditions, Is.EqualTo(accessConditions));
            Assert.That(aclExpansionEntry.AllowedAccessTypes, Is.EqualTo(AccessTypeDefinitions));
            Assert.That(aclExpansionEntry.DeniedAccessTypes, Is.EqualTo(AccessTypeDefinitions2));
        }
Exemple #4
0
 private IOrderedEnumerable <StateDefinition> GetAllStatesForAclExpansionEntry(AclExpansionEntry aclExpansionEntry)
 {
     // Get all states for AclExpansionEntry by flattening the StateCombinations of the AccessControlEntry ACL.
     return(aclExpansionEntry.GetStateCombinations().SelectMany(x => x.GetStates()).OrderBy(x => x.DisplayName));
 }