2009-05-06 Lluis Sanchez Gual <lluis@novell.com>
[mono.git] / mcs / class / corlib / System.Security.AccessControl / CustomAce.cs
index 5daecf72a97b63072b385e46a1d027794bfa30f8..6cb3b61002189a0db565f5d6b46249fbd0efa362 100644 (file)
@@ -1,10 +1,11 @@
 //
 // System.Security.AccessControl.CustomAce 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
 
 using System.Collections;
 
-namespace System.Security.AccessControl {
+namespace System.Security.AccessControl
+{
        public sealed class CustomAce : GenericAce
        {
-               public CustomAce (AceType type, AceFlags flags, byte[] opaque)
+               public CustomAce (AceType type, AceFlags flags, byte [] opaque)
+                       : base (type)
                {
-                       if (type <= AceType.MaxDefinedAceType) {
-                               throw new ArgumentOutOfRangeException ("type");
-                       }
+                       AceFlags = flags;
+
                        /* FIXME: check length of opaque >
                         * MaxOpaqueLength or !multiple of 4
                         */
-                       //AceType = type;
-                       //AceFlags = flags;
+                        SetOpaque (opaque);
                }
-               
+
+               byte [] opaque;
+
+               [MonoTODO]
                public static readonly int MaxOpaqueLength;
                
-               public override int BinaryLength
-               {
-                       get {
-                               throw new NotImplementedException ();
-                       }
+               [MonoTODO]
+               public override int BinaryLength {
+                       get { throw new NotImplementedException (); }
                }
                
-               public int OpaqueLength
-               {
-                       get {
-                               throw new NotImplementedException ();
-                       }
+               public int OpaqueLength {
+                       get { return opaque.Length; }
                }
-               
+
+               [MonoTODO]
                public override void GetBinaryForm (byte[] binaryForm,
                                                    int offset)
                {
                        throw new NotImplementedException ();
                }
                
-               public byte[] GetOpaque ()
+               public byte [] GetOpaque ()
                {
-                       throw new NotImplementedException ();
+                       return (byte []) opaque.Clone ();
                }
                
-               public void SetOpaque (byte[] opaque)
+               public void SetOpaque (byte [] opaque)
                {
-                       throw new NotImplementedException ();
+                       if (opaque == null)
+                               throw new ArgumentNullException ("opaque");
+                       this.opaque = (byte []) opaque.Clone ();
                }
        }
 }