2 // System.Security.AccessControl.ObjectSecurity implementation
5 // Dick Porter <dick@ximian.com>
6 // Atsushi Enomoto <atsushi@ximian.com>
8 // Copyright (C) 2005-2007 Novell, Inc (http://www.novell.com)
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:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
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
;
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; }
59 public bool AreAccessRulesCanonical
62 throw new NotImplementedException ();
67 public bool AreAccessRulesProtected
70 throw new NotImplementedException ();
75 public bool AreAuditRulesCanonical
78 throw new NotImplementedException ();
83 public bool AreAuditRulesProtected
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
);
123 public IdentityReference
GetGroup (Type targetType
)
125 throw new NotImplementedException ();
129 public IdentityReference
GetOwner (Type targetType
)
131 throw new NotImplementedException ();
135 public byte[] GetSecurityDescriptorBinaryForm ()
137 throw new NotImplementedException ();
141 public string GetSecurityDescriptorSddlForm (AccessControlSections includeSections
)
143 throw new NotImplementedException ();
147 public static bool IsSddlConversionSupported ()
149 throw new NotImplementedException ();
153 public virtual bool ModifyAccessRule (AccessControlModification modification
, AccessRule rule
, out bool modified
)
155 throw new NotImplementedException ();
159 public virtual bool ModifyAuditRule (AccessControlModification modification
, AuditRule rule
, out bool modified
)
161 throw new NotImplementedException ();
165 public virtual void PurgeAccessRules (IdentityReference identity
)
167 throw new NotImplementedException ();
171 public virtual void PurgeAuditRules (IdentityReference identity
)
173 throw new NotImplementedException ();
177 public void SetAccessRuleProtection (bool isProtected
,
178 bool preserveInheritance
)
180 throw new NotImplementedException ();
184 public void SetAuditRuleProtection (bool isProtected
,
185 bool preserveInheritance
)
187 throw new NotImplementedException ();
191 public void SetGroup (IdentityReference identity
)
193 throw new NotImplementedException ();
197 public void SetOwner (IdentityReference identity
)
199 throw new NotImplementedException ();
203 public void SetSecurityDescriptorBinaryForm (byte[] binaryForm
)
205 throw new NotImplementedException ();
209 public void SetSecurityDescriptorBinaryForm (byte[] binaryForm
, AccessControlSections includeSections
)
211 throw new NotImplementedException ();
215 public void SetSecurityDescriptorSddlForm (string sddlForm
)
217 throw new NotImplementedException ();
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
);
231 protected virtual void Persist (SafeHandle handle
, AccessControlSections includeSections
)
233 throw new NotImplementedException ();
237 protected virtual void Persist (string name
, AccessControlSections includeSections
)
239 throw new NotImplementedException ();
243 protected virtual void Persist (bool enableOwnershipPrivilege
, string name
, AccessControlSections includeSections
)
245 throw new NotImplementedException ();
249 protected void ReadLock ()
251 throw new NotImplementedException ();
255 protected void ReadUnlock ()
257 throw new NotImplementedException ();
261 protected void WriteLock ()
263 throw new NotImplementedException ();
267 protected void WriteUnlock ()
269 throw new NotImplementedException ();