public void TestAcl() { IDocument doc = null; try { doc = CreateTextDocument(Session.GetRootFolder(), "acl.txt", "Hello Joe!"); Ace joeAce = new Ace() { Principal = new Principal() { Id = "joe" }, Permissions = new List <string> { "cmis:write" } }; // apply ACL and test result IAcl newAcl = doc.ApplyAcl(new List <IAce> { joeAce }, null, AclPropagation.RepositoryDetermined); Assert.IsNotNull(newAcl); Assert.IsNotNull(newAcl.Aces); Assert.IsTrue(newAcl.Aces.Count > 0); // retrieve ACL and test IAcl acl2 = Session.GetAcl(doc, true); Assert.IsNotNull(acl2); Assert.IsNotNull(acl2.Aces); Assert.IsTrue(acl2.Aces.Count > 0); // fetch document and test IDocument doc2 = (IDocument)Session.GetObject(doc, OperationContextUtils.CreateMaximumOperationContext()); Assert.IsNotNull(doc2.Acl); Assert.IsNotNull(doc2.Acl.Aces); Assert.IsTrue(doc2.Acl.Aces.Count > 0); } finally { if (doc != null) { doc.Delete(); Assert.IsFalse(Session.Exists(doc)); } } }