2010-05-27 Jb Evain <jbevain@novell.com>
[mcs.git] / class / corlib / System.Security.AccessControl / ObjectSecurity.cs
blobe47ea8ae827cf189e600d0d79c9ffca7354f3694
1 //
2 // System.Security.AccessControl.ObjectSecurity implementation
3 //
4 // Authors:
5 // Dick Porter <dick@ximian.com>
6 // Atsushi Enomoto <atsushi@ximian.com>
7 //
8 // Copyright (C) 2005-2007 Novell, Inc (http://www.novell.com)
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
17 //
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
20 //
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 using System.Security.Principal;
31 using System.Runtime.InteropServices;
33 namespace System.Security.AccessControl
35 public abstract class ObjectSecurity
37 internal ObjectSecurity ()
39 /* Give it a 0-param constructor */
42 protected ObjectSecurity (bool isContainer, bool isDS)
44 is_container = isContainer;
45 is_ds = isDS;
48 bool is_container, is_ds;
49 bool access_rules_modified, audit_rules_modified;
50 bool group_modified, owner_modified;
52 public abstract Type AccessRightType { get; }
54 public abstract Type AccessRuleType { get; }
56 public abstract Type AuditRuleType { get; }
58 [MonoTODO]
59 public bool AreAccessRulesCanonical
61 get {
62 throw new NotImplementedException ();
66 [MonoTODO]
67 public bool AreAccessRulesProtected
69 get {
70 throw new NotImplementedException ();
74 [MonoTODO]
75 public bool AreAuditRulesCanonical
77 get {
78 throw new NotImplementedException ();
82 [MonoTODO]
83 public bool AreAuditRulesProtected
85 get {
86 throw new NotImplementedException ();
90 protected bool AccessRulesModified {
91 get { return access_rules_modified; }
92 set { access_rules_modified = value; }
95 protected bool AuditRulesModified {
96 get { return audit_rules_modified; }
97 set { audit_rules_modified = value; }
100 protected bool GroupModified {
101 get { return group_modified; }
102 set { group_modified = value; }
105 protected bool IsContainer {
106 get { return is_container; }
109 protected bool IsDS {
110 get { return is_ds; }
113 protected bool OwnerModified {
114 get { return owner_modified; }
115 set { owner_modified = value; }
118 public abstract AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type);
120 public abstract AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags);
122 [MonoTODO]
123 public IdentityReference GetGroup (Type targetType)
125 throw new NotImplementedException ();
128 [MonoTODO]
129 public IdentityReference GetOwner (Type targetType)
131 throw new NotImplementedException ();
134 [MonoTODO]
135 public byte[] GetSecurityDescriptorBinaryForm ()
137 throw new NotImplementedException ();
140 [MonoTODO]
141 public string GetSecurityDescriptorSddlForm (AccessControlSections includeSections)
143 throw new NotImplementedException ();
146 [MonoTODO]
147 public static bool IsSddlConversionSupported ()
149 throw new NotImplementedException ();
152 [MonoTODO]
153 public virtual bool ModifyAccessRule (AccessControlModification modification, AccessRule rule, out bool modified)
155 throw new NotImplementedException ();
158 [MonoTODO]
159 public virtual bool ModifyAuditRule (AccessControlModification modification, AuditRule rule, out bool modified)
161 throw new NotImplementedException ();
164 [MonoTODO]
165 public virtual void PurgeAccessRules (IdentityReference identity)
167 throw new NotImplementedException ();
170 [MonoTODO]
171 public virtual void PurgeAuditRules (IdentityReference identity)
173 throw new NotImplementedException ();
176 [MonoTODO]
177 public void SetAccessRuleProtection (bool isProtected,
178 bool preserveInheritance)
180 throw new NotImplementedException ();
183 [MonoTODO]
184 public void SetAuditRuleProtection (bool isProtected,
185 bool preserveInheritance)
187 throw new NotImplementedException ();
190 [MonoTODO]
191 public void SetGroup (IdentityReference identity)
193 throw new NotImplementedException ();
196 [MonoTODO]
197 public void SetOwner (IdentityReference identity)
199 throw new NotImplementedException ();
202 [MonoTODO]
203 public void SetSecurityDescriptorBinaryForm (byte[] binaryForm)
205 throw new NotImplementedException ();
208 [MonoTODO]
209 public void SetSecurityDescriptorBinaryForm (byte[] binaryForm, AccessControlSections includeSections)
211 throw new NotImplementedException ();
214 [MonoTODO]
215 public void SetSecurityDescriptorSddlForm (string sddlForm)
217 throw new NotImplementedException ();
220 [MonoTODO]
221 public void SetSecurityDescriptorSddlForm (string sddlForm, AccessControlSections includeSections)
223 throw new NotImplementedException ();
226 protected abstract bool ModifyAccess (AccessControlModification modification, AccessRule rule, out bool modified);
228 protected abstract bool ModifyAudit (AccessControlModification modification, AuditRule rule, out bool modified);
230 [MonoTODO]
231 protected virtual void Persist (SafeHandle handle, AccessControlSections includeSections)
233 throw new NotImplementedException ();
236 [MonoTODO]
237 protected virtual void Persist (string name, AccessControlSections includeSections)
239 throw new NotImplementedException ();
242 [MonoTODO]
243 protected virtual void Persist (bool enableOwnershipPrivilege, string name, AccessControlSections includeSections)
245 throw new NotImplementedException ();
248 [MonoTODO]
249 protected void ReadLock ()
251 throw new NotImplementedException ();
254 [MonoTODO]
255 protected void ReadUnlock ()
257 throw new NotImplementedException ();
260 [MonoTODO]
261 protected void WriteLock ()
263 throw new NotImplementedException ();
266 [MonoTODO]
267 protected void WriteUnlock ()
269 throw new NotImplementedException ();