Merge pull request #370 from sblom/master
[mono.git] / mcs / class / corlib / System.Security.AccessControl / SystemAcl.cs
1 //
2 // System.Security.AccessControl.SystemAcl implementation
3 //
4 // Authors:
5 //      Dick Porter  <dick@ximian.com>
6 //      Atsushi Enomoto  <atsushi@ximian.com>
7 //
8 // Copyright (C) 2006-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
30 using System.Security.Principal;
31
32 namespace System.Security.AccessControl
33 {
34         public sealed class SystemAcl : CommonAcl
35         {
36                 public SystemAcl (bool isContainer, bool isDS, int capacity)
37                         : base (isContainer, isDS, capacity)
38                 {
39                 }
40                 
41                 public SystemAcl (bool isContainer, bool isDS, RawAcl rawAcl)
42                         : base (isContainer, isDS, rawAcl)
43                 {
44                 }
45                 
46                 public SystemAcl (bool isContainer, bool isDS, byte revision, int capacity)
47                         : base (isContainer, isDS, revision, capacity)
48                 {
49                 }
50
51                 public void AddAudit (AuditFlags auditFlags,
52                                       SecurityIdentifier sid, int accessMask,
53                                       InheritanceFlags inheritanceFlags,
54                                       PropagationFlags propagationFlags)
55                 {
56                         // CommonAce?
57                         throw new NotImplementedException ();
58                 }
59                 
60                 public void AddAudit (AuditFlags auditFlags,
61                                       SecurityIdentifier sid, int accessMask,
62                                       InheritanceFlags inheritanceFlags,
63                                       PropagationFlags propagationFlags,
64                                       ObjectAceFlags objectFlags,
65                                       Guid objectType,
66                                       Guid inheritedObjectType)
67                 {
68                         // ObjectAce?
69                         throw new NotImplementedException ();
70                 }
71                 
72                 public bool RemoveAudit (AuditFlags auditFlags,
73                                          SecurityIdentifier sid,
74                                          int accessMask,
75                                          InheritanceFlags inheritanceFlags,
76                                          PropagationFlags propagationFlags)
77                 {
78                         throw new NotImplementedException ();
79                 }
80                 
81                 public bool RemoveAudit (AuditFlags auditFlags,
82                                          SecurityIdentifier sid,
83                                          int accessMask,
84                                          InheritanceFlags inheritanceFlags,
85                                          PropagationFlags propagationFlags,
86                                          ObjectAceFlags objectFlags,
87                                          Guid objectType,
88                                          Guid inheritedObjectType)
89                 {
90                         throw new NotImplementedException ();
91                 }
92                 
93                 public void RemoveAuditSpecific (AuditFlags auditFlags,
94                                                  SecurityIdentifier sid,
95                                                  int accessMask,
96                                                  InheritanceFlags inheritanceFlags,
97                                                  PropagationFlags propagationFlags)
98                 {
99                         throw new NotImplementedException ();
100                 }
101                 
102                 public void RemoveAuditSpecific (AuditFlags auditFlags,
103                                                  SecurityIdentifier sid,
104                                                  int accessMask,
105                                                  InheritanceFlags inheritanceFlags,
106                                                  PropagationFlags propagationFlags,
107                                                  ObjectAceFlags objectFlags,
108                                                  Guid objectType,
109                                                  Guid inheritedObjectType)
110                 {
111                         throw new NotImplementedException ();
112                 }
113                 
114                 public void SetAudit (AuditFlags auditFlags,
115                                       SecurityIdentifier sid,
116                                       int accessMask,
117                                       InheritanceFlags inheritanceFlags,
118                                       PropagationFlags propagationFlags)
119                 {
120                         throw new NotImplementedException ();
121                 }
122                 
123                 public void SetAudit (AuditFlags auditFlags,
124                                       SecurityIdentifier sid,
125                                       int accessMask,
126                                       InheritanceFlags inheritanceFlags,
127                                       PropagationFlags propagationFlags,
128                                       ObjectAceFlags objectFlags,
129                                       Guid objectType,
130                                       Guid inheritedObjectType)
131                 {
132                         throw new NotImplementedException ();
133                 }
134                 
135                 internal override void ApplyCanonicalSortToExplicitAces ()
136                 {
137                         int explicitCount = GetCanonicalExplicitAceCount ();
138                         ApplyCanonicalSortToExplicitAces (0, explicitCount);
139                 }
140                 
141                 internal override bool IsAceMeaningless (GenericAce ace)
142                 {
143                         if (base.IsAceMeaningless (ace)) return true;
144                         
145                         QualifiedAce qace = ace as QualifiedAce;
146                         if (null != qace) {
147                                 return !(AceQualifier.SystemAudit == qace.AceQualifier ||
148                                          AceQualifier.SystemAlarm == qace.AceQualifier);
149                         }
150                         
151                         return false;
152                 }
153         }
154 }
155