Merge pull request #439 from mono-soc-2012/garyb/iconfix
[mono.git] / mcs / class / corlib / System.Security.AccessControl / FileSystemSecurity.cs
index 389b45066fe2de1d7314b9754c40648247c56cb1..bd21bc009a6f1573ab8f341eef3af7300fec3b1b 100644 (file)
@@ -1,10 +1,13 @@
 //
 // System.Security.AccessControl.FileSystemSecurity implementation
 //
-// Author:
-//     Dick Porter <dick@ximian.com>
+// Authors:
+//     Dick Porter  <dick@ximian.com>
+//     Atsushi Enomoto  <atsushi@ximian.com>
+//     James Bellinger  <jfb@zer7.com>
 //
-// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2006-2007 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2012      James Bellinger
 //
 // 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.Runtime.InteropServices;
 using System.Security.Principal;
 
-namespace System.Security.AccessControl {
-       public abstract class FileSystemSecurity : NativeObjectSecurity {
-               public override Type AccessRightType
+namespace System.Security.AccessControl
+{
+       public abstract class FileSystemSecurity : NativeObjectSecurity
+       {
+               internal FileSystemSecurity (bool isContainer)
+                       : base (isContainer, ResourceType.FileObject)
                {
-                       get {
-                               throw new NotImplementedException ();
-                       }
                }
-               
-               public override Type AccessRuleType
+
+               internal FileSystemSecurity (bool isContainer, string name, AccessControlSections includeSections)
+                       : base (isContainer, ResourceType.FileObject, name, includeSections)
                {
-                       get {
-                               throw new NotImplementedException ();
-                       }
                }
 
-               public override Type AuditRuleType
+               internal FileSystemSecurity (bool isContainer, SafeHandle handle, AccessControlSections includeSections)
+                       : base (isContainer, ResourceType.FileObject, handle, includeSections)
                {
-                       get {
-                               throw new NotImplementedException ();
-                       }
                }
                
-               public override sealed AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
+               public override Type AccessRightType {
+                       get { return typeof (FileSystemRights); }
+               }
+               
+               public override Type AccessRuleType {
+                       get { return typeof (FileSystemAccessRule); }
+               }
+
+               public override Type AuditRuleType {
+                       get { return typeof (FileSystemAuditRule); }
+               }
+
+               public override sealed AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask,
+                                                                    bool isInherited, InheritanceFlags inheritanceFlags,
+                                                                    PropagationFlags propagationFlags, AccessControlType type)
                {
-                       throw new NotImplementedException ();
+                       return new FileSystemAccessRule (identityReference, (FileSystemRights) accessMask, isInherited,
+                                                        inheritanceFlags, propagationFlags, type);
                }
                
                public void AddAccessRule (FileSystemAccessRule rule)
                {
-                       throw new NotImplementedException ();
+                       AddAccessRule ((AccessRule)rule);
                }
                
-               public void AddAuditRule (FileSystemAuditRule rule)
+               public bool RemoveAccessRule (FileSystemAccessRule rule)
                {
-                       throw new NotImplementedException ();
+                       return RemoveAccessRule ((AccessRule)rule);
                }
                
-               public override sealed AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
+               public void RemoveAccessRuleAll (FileSystemAccessRule rule)
                {
-                       throw new NotImplementedException ();
+                       RemoveAccessRuleAll ((AccessRule)rule);
                }
                
-               public bool RemoveAccessRule (FileSystemAccessRule rule)
+               public void RemoveAccessRuleSpecific (FileSystemAccessRule rule)
                {
-                       throw new NotImplementedException ();
+                       RemoveAccessRuleSpecific ((AccessRule)rule);
                }
                
-               public void RemoveAccessRuleAll (FileSystemAccessRule rule)
+               public void ResetAccessRule (FileSystemAccessRule rule)
                {
-                       throw new NotImplementedException ();
+                       ResetAccessRule ((AccessRule)rule);
                }
                
-               public void RemoveAccessRuleSpecific (FileSystemAccessRule rule)
+               public void SetAccessRule (FileSystemAccessRule rule)
                {
-                       throw new NotImplementedException ();
+                       SetAccessRule ((AccessRule)rule);
                }
                
-               public bool RemoveAuditRule (FileSystemAuditRule rule)
+               public override sealed AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask,
+                                                                  bool isInherited, InheritanceFlags inheritanceFlags,
+                                                                  PropagationFlags propagationFlags, AuditFlags flags)
                {
-                       throw new NotImplementedException ();
+                       return new FileSystemAuditRule (identityReference, (FileSystemRights) accessMask, isInherited,
+                                                       inheritanceFlags, propagationFlags, flags);
                }
                
-               public void RemoveAuditRuleAll (FileSystemAuditRule rule)
+               public void AddAuditRule (FileSystemAuditRule rule)
                {
-                       throw new NotImplementedException ();
+                       AddAuditRule ((AuditRule)rule);
                }
                
-               public void RemoveAuditRuleSpecific (FileSystemAuditRule rule)
+               public bool RemoveAuditRule (FileSystemAuditRule rule)
                {
-                       throw new NotImplementedException ();
+                       return RemoveAuditRule((AuditRule)rule);
                }
                
-               public void ResetAccessRule (FileSystemAccessRule rule)
+               public void RemoveAuditRuleAll (FileSystemAuditRule rule)
                {
-                       throw new NotImplementedException ();
+                       RemoveAuditRuleAll((AuditRule)rule);
                }
                
-               public void SetAccessRule (FileSystemAccessRule rule)
+               public void RemoveAuditRuleSpecific (FileSystemAuditRule rule)
                {
-                       throw new NotImplementedException ();
+                       RemoveAuditRuleSpecific((AuditRule)rule);
                }
                
                public void SetAuditRule (FileSystemAuditRule rule)
                {
-                       throw new NotImplementedException ();
+                       SetAuditRule((AuditRule)rule);
                }
        }
 }
 
-#endif