mono/mono — pull request #369 by JamesB7 (2012-07-03 03:55:07+00:00)
Title: Completely implemented System.Security.AccessControl.CommonAcl

Howdy,

This patch provides what should be a complete implementation of CommonAcl.
Other fixes had to be done to make that happen as well -- SecurityIdentifier's CompareTo was simple but provided the wrong ordering, ObjectAce did not deserialize properly if opaque data was provided and would not round-trip (and produced data of the wrong length for some flag combinations), etc. Lots of bugs found and fixed.

Unit tests are included. Since CommonAcl was so poorly documented, for parts where the actual behavior were unclear, I started by building the tests, ran NUnit against MS.NET's CommonAcl, and then wrote the Mono class. For instance CommonAcl's docs say that it sorts ACE groupings by SecurityIdentifier's CompareTo, but the latter is documented nowhere. There's a rather long unit test for that ordeal. Found a lot of quirks with this unusual approach, but it's done now. :-)

For the future, the DiscretionaryAcl and SystemAcl will need their own methods implemented. While the unit test shows that a lot can be done with the CommonAcl collection, DiscretionaryAcl and SystemAcl will need to be implemented before CommonObjectSecurity can be. So, this is one step on the journey to working ACL support.