Weblog
Much more CAS samples
Ok, I promise it's the last one on samples, but it's worth it as I finally got around most MSDN library samples about CAS.
A got a few surprises (i.e. really not anticipated), like PermissionSet.IsEmpty() returning true even if PermissionSet.Count > 1 - but only when the included permissions are themself "somewhat" empty (as there is no IPermission.IsEmpty() method).
I also had a few "non" surprises (i.e. I could/should have anticipated them). Many were due to the fact that IPermission.Intersect can return null or an empty set (new PermissionSet (PermissionState.None)) as an empty result (which resulted in a number of NullReferenceException). Support for more wildcards in permissions, like in StrongName "names" (that's one I should have seen coming).
And finally some, always subtle, differences between Fx 1.1 and 2.0 beta 1. Anyway I suspect I'll get more (and probably less subtle) differences in the next 2.0 betas - like unrestricted identity permissions.
This time I won't bore you with all the gory step-by-step details - as a summary should be good enough ;-). So here are the current results using CVS...
In System.Security namespace:
PermissionSet -Fully workingNamedPermissionSet -not fully working [1]SecurityElement -Fully workingSecurityManager -not fully working [1]
[1] Permissions classes outside mscorlib.dll aren't completed. This is a case where throwing NotImplementedException isn't the best solution.
In System.Security.Permissions namespace:
EnvironmentPermission -Fully workingFileDialogPermission -Fully workingFileIOPermission -Fully working [2]IsolatedStorageFilePermission -not fully working [3]PublisherPermission -Fully workingReflectionPermission -Fully workingRegistryPermission -Fully workingSecurityPermission -Fully workingSiteIdentityPermission -Fully workingStrongNameIdentityPermission-1 -not fully working [4]StrongNameIdentityPermission-2 -Fully workingUIPermission -Fully workingUrlIdentityPermission -Fully workingZoneIdentityPermission -Fully working
[2] Some filenames had to be changed in order to run under Linux.
[3] Everything works except Deny and PermitOnly (not implemented yet). Other samples do not use them.
[4] Requires declarative permission support (not implemented yet).
In System.Security.Policy namespace:
Evidence -Fully working [5]FileMatchCodeGroup -Fully working [2]FirstMatchCodeGroup -Fully working [2]PolicyLevel -not fully working [6]PolicyStatement -Fully working
[5] Commented Fx 2.0 specific stuff.
[6] FullTrustAssemblies aren't implemented. It also need more love in resolution.
9/6/2004 18:23:57 | Comments
The views expressed on this website/weblog are mine alone and do not necessarily reflect the views of my employer.
