public void OnCommitting_WithChangedPermission_RegistersClassForCommit() { var classDefinition = _testHelper.CreateClassDefinition("SecurableClass"); var acl = _testHelper.CreateStatelessAcl(classDefinition); var ace = _testHelper.CreateAceWithOwningUser(); acl.AccessControlEntries.Add(ace); var accessType = _testHelper.AttachJournalizeAccessType(classDefinition); ace.AllowAccess(accessType); using (ClientTransaction.Current.CreateSubTransaction().EnterDiscardingScope()) { bool commitOnClassWasCalled = false; classDefinition.Committing += (sender, e) => { commitOnClassWasCalled = true; Assert.That(GetDataContainer((DomainObject)sender).HasBeenMarkedChanged, Is.True); }; ace.GetPermissions()[0].RegisterForCommit(); ClientTransaction.Current.Commit(); Assert.That(commitOnClassWasCalled, Is.True); } }