Esempio n. 1
0
        public SecurableClassDefinition CreateAndCommitSecurableClassDefinitionWithAccessControlLists(int accessControlLists, ClientTransaction transaction)
        {
            CreateEmptyDomain();

            using (transaction.EnterNonDiscardingScope())
            {
                SecurableClassDefinition   classDefinition            = CreateOrderSecurableClassDefinition();
                StatelessAccessControlList statelessAccessControlList = StatelessAccessControlList.NewObject();
                classDefinition.StatelessAccessControlList = statelessAccessControlList;

                var stateProperty = StatePropertyDefinition.NewObject(Guid.NewGuid(), "Property");
                classDefinition.AddStateProperty(stateProperty);

                for (int i = 1; i < accessControlLists; i++)
                {
                    StatefulAccessControlList statefulAccessControlList = StatefulAccessControlList.NewObject();
                    classDefinition.StatefulAccessControlLists.Add(statefulAccessControlList);
                    statefulAccessControlList.CreateAccessControlEntry();
                    CreateStateCombination(statefulAccessControlList, stateProperty, StateDefinition.NewObject(string.Format("Value {0}", i), i));
                }

                ClientTransactionScope.CurrentTransaction.Commit();

                return(classDefinition);
            }
        }
Esempio n. 2
0
        private AccessControlEntry CreateAceForStateless()
        {
            var ace = AccessControlEntry.NewObject();

            ace.AccessControlList = StatelessAccessControlList.NewObject();

            return(ace);
        }
Esempio n. 3
0
 public StatelessAccessControlList CreateStatelessAcl(SecurableClassDefinition classDefinition, ClientTransaction transaction)
 {
     using (transaction.EnterNonDiscardingScope())
     {
         var acl = StatelessAccessControlList.NewObject();
         classDefinition.StatelessAccessControlList = acl;
         return(acl);
     }
 }
Esempio n. 4
0
        public StatelessAccessControlList CreateStatelessAccessControlList()
        {
            if (StatelessAccessControlList != null)
            {
                throw new InvalidOperationException("A SecurableClassDefinition only supports a single StatelessAccessControlList at a time.");
            }

            var accessControlList = StatelessAccessControlList.NewObject();

            StatelessAccessControlList = accessControlList;
            accessControlList.CreateAccessControlEntry();

            return(accessControlList);
        }
Esempio n. 5
0
        public void CreateAccessControlEntry_BeforeClassIsSet_WithStatelessAccessControlList()
        {
            AccessControlList acl = StatelessAccessControlList.NewObject();

            acl.CreateAccessControlEntry();
        }