Merge pull request #439 from mono-soc-2012/garyb/iconfix
[mono.git] / mcs / class / corlib / System.Security.AccessControl / RegistryAccessRule.cs
index 9f81acd84937aa917f6bfa63d92711e8cf198c48..b5978c71547793d9045d5df5ceb0e7b79616633c 100644 (file)
@@ -1,10 +1,11 @@
 //
 // System.Security.AccessControl.RegistryAccessRule implementation
 //
-// Author:
+// Authors:
 //     Dick Porter  <dick@ximian.com>
+//     Atsushi Enomoto  <atsushi@ximian.com>
 //
-// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2006-2007 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System.Security.Principal;
 
-namespace System.Security.AccessControl {
+namespace System.Security.AccessControl 
+{
        public sealed class RegistryAccessRule : AccessRule
        {
-               RegistryRights registryRights;
-               
                public RegistryAccessRule (IdentityReference identity,
                                           RegistryRights registryRights,
                                           AccessControlType type)
+                       : this (identity, registryRights, InheritanceFlags.None, PropagationFlags.None, type)
                {
-                       this.registryRights = registryRights;
                }
 
                public RegistryAccessRule (string identity,
                                           RegistryRights registryRights,
                                           AccessControlType type)
+                       : this (new NTAccount (identity), registryRights, type)
                {
-                       this.registryRights = registryRights;
                }
 
                public RegistryAccessRule (IdentityReference identity,
@@ -54,26 +52,32 @@ namespace System.Security.AccessControl {
                                           InheritanceFlags inheritanceFlags,
                                           PropagationFlags propagationFlags,
                                           AccessControlType type)
+                       : this (identity, registryRights, false, inheritanceFlags, propagationFlags, type)
                {
-                       this.registryRights = registryRights;
                }
                
+               internal RegistryAccessRule (IdentityReference identity,
+                                            RegistryRights registryRights,
+                                            bool isInherited,
+                                            InheritanceFlags inheritanceFlags,
+                                            PropagationFlags propagationFlags,
+                                            AccessControlType type)
+                       : base (identity, (int)registryRights, isInherited, inheritanceFlags, propagationFlags, type)
+               {
+               }
+
                public RegistryAccessRule (string identity,
                                           RegistryRights registryRights,
                                           InheritanceFlags inheritanceFlags,
                                           PropagationFlags propagationFlags,
                                           AccessControlType type)
+                       : this (new NTAccount (identity), registryRights, inheritanceFlags, propagationFlags, type)
                {
-                       this.registryRights = registryRights;
                }
-               
-               public RegistryRights RegistryRights
-               {
-                       get {
-                               return(registryRights);
-                       }
+                               
+               public RegistryRights RegistryRights {
+                       get { return (RegistryRights)AccessMask; }
                }
        }
 }
 
-#endif