ObjectSecurity.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. //
  2. // System.Security.AccessControl.ObjectSecurity implementation
  3. //
  4. // Authors:
  5. // Dick Porter <[email protected]>
  6. // Atsushi Enomoto <[email protected]>
  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.
  28. //
  29. using System.Security.Principal;
  30. using System.Runtime.InteropServices;
  31. namespace System.Security.AccessControl
  32. {
  33. public abstract class ObjectSecurity
  34. {
  35. internal ObjectSecurity ()
  36. {
  37. /* Give it a 0-param constructor */
  38. }
  39. protected ObjectSecurity (bool isContainer, bool isDS)
  40. {
  41. is_container = isContainer;
  42. is_ds = isDS;
  43. }
  44. bool is_container, is_ds;
  45. bool access_rules_modified, audit_rules_modified;
  46. bool group_modified, owner_modified;
  47. public abstract Type AccessRightType { get; }
  48. public abstract Type AccessRuleType { get; }
  49. public abstract Type AuditRuleType { get; }
  50. [MonoTODO]
  51. public bool AreAccessRulesCanonical
  52. {
  53. get {
  54. throw new NotImplementedException ();
  55. }
  56. }
  57. [MonoTODO]
  58. public bool AreAccessRulesProtected
  59. {
  60. get {
  61. throw new NotImplementedException ();
  62. }
  63. }
  64. [MonoTODO]
  65. public bool AreAuditRulesCanonical
  66. {
  67. get {
  68. throw new NotImplementedException ();
  69. }
  70. }
  71. [MonoTODO]
  72. public bool AreAuditRulesProtected
  73. {
  74. get {
  75. throw new NotImplementedException ();
  76. }
  77. }
  78. protected bool AccessRulesModified {
  79. get { return access_rules_modified; }
  80. set { access_rules_modified = value; }
  81. }
  82. protected bool AuditRulesModified {
  83. get { return audit_rules_modified; }
  84. set { audit_rules_modified = value; }
  85. }
  86. protected bool GroupModified {
  87. get { return group_modified; }
  88. set { group_modified = value; }
  89. }
  90. protected bool IsContainer {
  91. get { return is_container; }
  92. }
  93. protected bool IsDS {
  94. get { return is_ds; }
  95. }
  96. protected bool OwnerModified {
  97. get { return owner_modified; }
  98. set { owner_modified = value; }
  99. }
  100. public abstract AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type);
  101. public abstract AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags);
  102. [MonoTODO]
  103. public IdentityReference GetGroup (Type targetType)
  104. {
  105. throw new NotImplementedException ();
  106. }
  107. [MonoTODO]
  108. public IdentityReference GetOwner (Type targetType)
  109. {
  110. throw new NotImplementedException ();
  111. }
  112. [MonoTODO]
  113. public byte[] GetSecurityDescriptorBinaryForm ()
  114. {
  115. throw new NotImplementedException ();
  116. }
  117. [MonoTODO]
  118. public string GetSecurityDescriptorSddlForm (AccessControlSections includeSections)
  119. {
  120. throw new NotImplementedException ();
  121. }
  122. [MonoTODO]
  123. public static bool IsSddlConversionSupported ()
  124. {
  125. throw new NotImplementedException ();
  126. }
  127. [MonoTODO]
  128. public virtual bool ModifyAccessRule (AccessControlModification modification, AccessRule rule, out bool modified)
  129. {
  130. throw new NotImplementedException ();
  131. }
  132. [MonoTODO]
  133. public virtual bool ModifyAuditRule (AccessControlModification modification, AuditRule rule, out bool modified)
  134. {
  135. throw new NotImplementedException ();
  136. }
  137. [MonoTODO]
  138. public virtual void PurgeAccessRules (IdentityReference identity)
  139. {
  140. throw new NotImplementedException ();
  141. }
  142. [MonoTODO]
  143. public virtual void PurgeAuditRules (IdentityReference identity)
  144. {
  145. throw new NotImplementedException ();
  146. }
  147. [MonoTODO]
  148. public void SetAccessRuleProtection (bool isProtected,
  149. bool preserveInheritance)
  150. {
  151. throw new NotImplementedException ();
  152. }
  153. [MonoTODO]
  154. public void SetAuditRuleProtection (bool isProtected,
  155. bool preserveInheritance)
  156. {
  157. throw new NotImplementedException ();
  158. }
  159. [MonoTODO]
  160. public void SetGroup (IdentityReference identity)
  161. {
  162. throw new NotImplementedException ();
  163. }
  164. [MonoTODO]
  165. public void SetOwner (IdentityReference identity)
  166. {
  167. throw new NotImplementedException ();
  168. }
  169. [MonoTODO]
  170. public void SetSecurityDescriptorBinaryForm (byte[] binaryForm)
  171. {
  172. throw new NotImplementedException ();
  173. }
  174. [MonoTODO]
  175. public void SetSecurityDescriptorBinaryForm (byte[] binaryForm, AccessControlSections includeSections)
  176. {
  177. throw new NotImplementedException ();
  178. }
  179. [MonoTODO]
  180. public void SetSecurityDescriptorSddlForm (string sddlForm)
  181. {
  182. throw new NotImplementedException ();
  183. }
  184. [MonoTODO]
  185. public void SetSecurityDescriptorSddlForm (string sddlForm, AccessControlSections includeSections)
  186. {
  187. throw new NotImplementedException ();
  188. }
  189. protected abstract bool ModifyAccess (AccessControlModification modification, AccessRule rule, out bool modified);
  190. protected abstract bool ModifyAudit (AccessControlModification modification, AuditRule rule, out bool modified);
  191. [MonoTODO]
  192. protected virtual void Persist (SafeHandle handle, AccessControlSections includeSections)
  193. {
  194. throw new NotImplementedException ();
  195. }
  196. [MonoTODO]
  197. protected virtual void Persist (string name, AccessControlSections includeSections)
  198. {
  199. throw new NotImplementedException ();
  200. }
  201. [MonoTODO]
  202. protected virtual void Persist (bool enableOwnershipPrivilege, string name, AccessControlSections includeSections)
  203. {
  204. throw new NotImplementedException ();
  205. }
  206. [MonoTODO]
  207. protected void ReadLock ()
  208. {
  209. throw new NotImplementedException ();
  210. }
  211. [MonoTODO]
  212. protected void ReadUnlock ()
  213. {
  214. throw new NotImplementedException ();
  215. }
  216. [MonoTODO]
  217. protected void WriteLock ()
  218. {
  219. throw new NotImplementedException ();
  220. }
  221. [MonoTODO]
  222. protected void WriteUnlock ()
  223. {
  224. throw new NotImplementedException ();
  225. }
  226. }
  227. }