8 private bool _isContainer;
18 internal sealed
override GenericAcl GenericSacl => _sacl;
20 internal sealed
override GenericAcl GenericDacl => _dacl;
80 if (value.IsDS !=
IsDS)
82 throw new ArgumentException(
Environment.GetResourceString(
IsDS ?
"AccessControl_MustSpecifyDirectoryObjectAcl" :
"AccessControl_MustSpecifyNonDirectoryObjectAcl"),
"value");
115 if (value.IsDS !=
IsDS)
117 throw new ArgumentException(
Environment.GetResourceString(
IsDS ?
"AccessControl_MustSpecifyDirectoryObjectAcl" :
"AccessControl_MustSpecifyNonDirectoryObjectAcl"),
"value");
169 if (systemAcl !=
null && systemAcl.
IsContainer != isContainer)
171 throw new ArgumentException(
Environment.GetResourceString(isContainer ?
"AccessControl_MustSpecifyContainerAcl" :
"AccessControl_MustSpecifyLeafObjectAcl"),
"systemAcl");
173 if (discretionaryAcl !=
null && discretionaryAcl.
IsContainer != isContainer)
175 throw new ArgumentException(
Environment.GetResourceString(isContainer ?
"AccessControl_MustSpecifyContainerAcl" :
"AccessControl_MustSpecifyLeafObjectAcl"),
"discretionaryAcl");
177 _isContainer = isContainer;
178 if (systemAcl !=
null && systemAcl.
IsDS != isDS)
180 throw new ArgumentException(
Environment.GetResourceString(isDS ?
"AccessControl_MustSpecifyDirectoryObjectAcl" :
"AccessControl_MustSpecifyNonDirectoryObjectAcl"),
"systemAcl");
182 if (discretionaryAcl !=
null && discretionaryAcl.
IsDS != isDS)
184 throw new ArgumentException(Environment.GetResourceString(isDS ?
"AccessControl_MustSpecifyDirectoryObjectAcl" :
"AccessControl_MustSpecifyNonDirectoryObjectAcl"),
"discretionaryAcl");
188 if (discretionaryAcl ==
null)
190 discretionaryAcl =
DiscretionaryAcl.CreateAllowEveryoneFullAccess(_isDS, _isContainer);
192 _dacl = discretionaryAcl;
194 controlFlags = ((systemAcl !=
null) ? (controlFlags |
ControlFlags.SystemAclPresent) : (controlFlags & ~
ControlFlags.SystemAclPresent));
195 _rawSd =
new RawSecurityDescriptor(controlFlags, owner, group, systemAcl?.RawAcl, discretionaryAcl.RawAcl);
210 CreateFromParts(isContainer, isDS, flags, owner, group, systemAcl, discretionaryAcl);
214 : this(isContainer, isDS, flags, owner, group, (systemAcl == null) ? null : new
SystemAcl(isContainer, isDS, systemAcl), (discretionaryAcl == null) ? null : new
DiscretionaryAcl(isContainer, isDS, discretionaryAcl))
225 : this(isContainer, isDS, rawSecurityDescriptor, trusted: false)
231 if (rawSecurityDescriptor ==
null)
235 CreateFromParts(isContainer, isDS, rawSecurityDescriptor.
ControlFlags, rawSecurityDescriptor.
Owner, rawSecurityDescriptor.
Group, (rawSecurityDescriptor.
SystemAcl ==
null) ?
null :
new SystemAcl(isContainer, isDS, rawSecurityDescriptor.
SystemAcl, trusted), (rawSecurityDescriptor.
DiscretionaryAcl ==
null) ?
null :
new DiscretionaryAcl(isContainer, isDS, rawSecurityDescriptor.
DiscretionaryAcl, trusted));
273 if (!preserveInheritance &&
SystemAcl !=
null)
289 RemoveControlFlags(
ControlFlags.DiscretionaryAclProtected);
297 AddControlFlags(
ControlFlags.DiscretionaryAclProtected);
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
bool IsCanonical
Gets a Boolean value that specifies whether the access control entries (ACEs) in the current T:System...
override ControlFlags ControlFlags
Gets values that specify behavior of the T:System.Security.AccessControl.RawSecurityDescriptor object...
void SetDiscretionaryAclProtection(bool isProtected, bool preserveInheritance)
Sets the inheritance protection for the Discretionary Access Control List (DACL) associated with this...
Represents a security descriptor. A security descriptor includes an owner, a primary group,...
SystemAcl?? SystemAcl
Gets or sets the System Access Control List (SACL) for this T:System.Security.AccessControl....
bool IsDiscretionaryAclCanonical
Gets a Boolean value that specifies whether the Discretionary Access Control List (DACL) associated w...
override ControlFlags ControlFlags
Gets values that specify behavior of the T:System.Security.AccessControl.CommonSecurityDescriptor obj...
override SecurityIdentifier Group
Gets or sets the primary group for this T:System.Security.AccessControl.RawSecurityDescriptor object.
void PurgeAudit(SecurityIdentifier sid)
Removes all audit rules for the specified security identifier from the System Access Control List (SA...
void PurgeAccessControl(SecurityIdentifier sid)
Removes all access rules for the specified security identifier from the Discretionary Access Control ...
Represents an Access Control List (ACL).
DiscretionaryAcl?? DiscretionaryAcl
Gets or sets the discretionary access control list (DACL) for this T:System.Security....
override SecurityIdentifier Owner
Gets or sets the owner of the object associated with this T:System.Security.AccessControl....
CommonSecurityDescriptor(bool isContainer, bool isDS, ControlFlags flags, SecurityIdentifier owner, SecurityIdentifier group, SystemAcl systemAcl, DiscretionaryAcl discretionaryAcl)
Initializes a new instance of the T:System.Security.AccessControl.CommonSecurityDescriptor class from...
Provides information about, and means to manipulate, the current environment and platform....
void AddSystemAcl(byte revision, int trusted)
Sets the P:System.Security.AccessControl.CommonSecurityDescriptor.SystemAcl property for this T:Syste...
Represents a security descriptor. A security descriptor includes an owner, a primary group,...
CommonSecurityDescriptor(bool isContainer, bool isDS, RawSecurityDescriptor rawSecurityDescriptor)
Initializes a new instance of the T:System.Security.AccessControl.CommonSecurityDescriptor class from...
RawAcl SystemAcl
Gets or sets the System Access Control List (SACL) for this T:System.Security.AccessControl....
void AddDiscretionaryAcl(byte revision, int trusted)
Sets the P:System.Security.AccessControl.CommonSecurityDescriptor.DiscretionaryAcl property for this ...
ControlFlags
These flags affect the security descriptor behavior.
void SetSystemAclProtection(bool isProtected, bool preserveInheritance)
Sets the inheritance protection for the System Access Control List (SACL) associated with this T:Syst...
void RemoveInheritedAces()
Removes all inherited access control entries (ACEs) from this T:System.Security.AccessControl....
override SecurityIdentifier Owner
Gets or sets the owner of the object associated with this T:System.Security.AccessControl....
Represents a security descriptor. A security descriptor includes an owner, a primary group,...
The exception that is thrown when one of the arguments provided to a method is not valid.
RawAcl DiscretionaryAcl
Gets or sets the Discretionary Access Control List (DACL) for this T:System.Security....
bool IsDS
Gets a Boolean value that specifies whether the object associated with this T:System....
void SetFlags(ControlFlags flags)
Sets the P:System.Security.AccessControl.RawSecurityDescriptor.ControlFlags property of this T:System...
CommonSecurityDescriptor(bool isContainer, bool isDS, string sddlForm)
Initializes a new instance of the T:System.Security.AccessControl.CommonSecurityDescriptor class from...
Represents an access control list (ACL) and is the base class for the T:System.Security....
bool IsSystemAclCanonical
Gets a Boolean value that specifies whether the System Access Control List (SACL) associated with thi...
Represents a security identifier (SID) and provides marshaling and comparison operations for SIDs.
bool IsContainer
Sets whether the T:System.Security.AccessControl.CommonAcl object is a container.
override SecurityIdentifier Group
Gets or sets the primary group for this T:System.Security.AccessControl.CommonSecurityDescriptor obje...
Represents a Discretionary Access Control List (DACL).
void Purge(SecurityIdentifier sid)
Removes all access control entries (ACEs) contained by this T:System.Security.AccessControl....
bool IsDS
Sets whether the current T:System.Security.AccessControl.CommonAcl object is a directory object acces...
CommonSecurityDescriptor(bool isContainer, bool isDS, byte[] binaryForm, int offset)
Initializes a new instance of the T:System.Security.AccessControl.CommonSecurityDescriptor class from...
Represents a System Access Control List (SACL).
bool IsContainer
Gets a Boolean value that specifies whether the object associated with this T:System....