Merge pull request #439 from mono-soc-2012/garyb/iconfix
[mono.git] / mcs / class / corlib / System.Security.AccessControl / RegistryAccessRule.cs
index 06ee5a2b0a41ff45ea6b0e78cfa8096773dc3380..b5978c71547793d9045d5df5ceb0e7b79616633c 100644 (file)
@@ -33,8 +33,6 @@ namespace System.Security.AccessControl
 {
        public sealed class RegistryAccessRule : AccessRule
        {
-               RegistryRights rights;
-               
                public RegistryAccessRule (IdentityReference identity,
                                           RegistryRights registryRights,
                                           AccessControlType type)
@@ -54,12 +52,20 @@ namespace System.Security.AccessControl
                                           InheritanceFlags inheritanceFlags,
                                           PropagationFlags propagationFlags,
                                           AccessControlType type)
-                       // FIXME: accessMask=0 likely causes an error
-                       : base (identity.Translate(typeof(SecurityIdentifier)), 0, false, inheritanceFlags, propagationFlags, type)
+                       : this (identity, registryRights, false, inheritanceFlags, propagationFlags, type)
                {
-                       this.rights = 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,
@@ -68,9 +74,9 @@ namespace System.Security.AccessControl
                        : this (new NTAccount (identity), registryRights, inheritanceFlags, propagationFlags, type)
                {
                }
-               
+                               
                public RegistryRights RegistryRights {
-                       get { return rights; }
+                       get { return (RegistryRights)AccessMask; }
                }
        }
 }