Implemented the .NET 4.0 generic versions of AccessRule and AuditRule.
authorJames Bellinger <jfb@zer7.com>
Sat, 30 Jun 2012 17:21:46 +0000 (13:21 -0400)
committerJames Bellinger <jfb@zer7.com>
Sat, 30 Jun 2012 17:21:46 +0000 (13:21 -0400)
commit4fb4aa1120b17d161bde909d289da3070854fba4
tree1749e5b353c52b736a0e8f9995aa819adad728a7
parent7fd71833d327ac97133b6bd3fd7c0ad8a25a3f11
Implemented the .NET 4.0 generic versions of AccessRule and AuditRule.

Details worth being aware of, that aren't well documented in MS.NET:

(1) The Rights property is just a casted AccessMask.
I've checked this by testing with MS.NET -- if you use AccessRule<Test>
with an arbitrary struct Test { }, MS.NET has an InvalidCastException
on the Rights getter if you create with ObjectSecurity's factory method
(which is passed an int), and in the constructor if you use AccessRule's
constructor.

(2) The string constructor overloads call 'new NTAccount(identity)'.
What these methods do for AccessRule is not documented by MS.NET,
but this *is* documented for SemaphoreAccessRule, and my testing
with C# shows AccessRule does the same thing. So, I've implemented
this behavior to match.

I will submit a separate patch afterwards to make AuthorizationRule's
accept NTAccount, which is required for the string overloads to work.
Contrary to the MS.NET *documentation* (which Mono follows), AuthorizationRule
actually accepts NTAccount as well as (the documented) SecurityIdentifier.
I verified this by deriving a class from AuthorizationRule.
mcs/class/corlib/System.Security.AccessControl/AccessRule_T.cs [new file with mode: 0644]
mcs/class/corlib/System.Security.AccessControl/AuditRule_T.cs [new file with mode: 0644]
mcs/class/corlib/System.Security.AccessControl/ChangeLog
mcs/class/corlib/System.Security.AccessControl/ObjectSecurity_T.cs
mcs/class/corlib/corlib.dll.sources