Files
2026-06-04 11:42:34 +02:00

81 lines
8.2 KiB
C#

using System;
using System.Security.Principal;
namespace System.Security.AccessControl
{
/// <summary>Represents an abstraction of an access control entry (ACE) that defines an access rule for a file or directory. This class cannot be inherited.</summary>
// Token: 0x020004C2 RID: 1218
public sealed class FileSystemAccessRule : AccessRule
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.AccessControl.FileSystemAccessRule" /> class using a reference to a user account, a value that specifies the type of operation associated with the access rule, and a value that specifies whether to allow or deny the operation. </summary>
/// <param name="identity">An <see cref="T:System.Security.Principal.IdentityReference" /> object that encapsulates a reference to a user account.</param>
/// <param name="fileSystemRights">One of the <see cref="T:System.Security.AccessControl.FileSystemRights" /> values that specifies the type of operation associated with the access rule. </param>
/// <param name="type">One of the <see cref="T:System.Security.AccessControl.AccessControlType" /> values that specifies whether to allow or deny the operation.</param>
/// <exception cref="T:System.ArgumentException">The <paramref name="identity" /> parameter is not an <see cref="T:System.Security.Principal.IdentityReference" /> object.</exception>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="identity" /> parameter is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">An incorrect enumeration was passed to the <paramref name="type " />parameter.</exception>
// Token: 0x06002D4C RID: 11596 RVA: 0x00093908 File Offset: 0x00091B08
public FileSystemAccessRule(IdentityReference identity, FileSystemRights fileSystemRights, AccessControlType type)
: this(identity, fileSystemRights, InheritanceFlags.None, PropagationFlags.None, type)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.AccessControl.FileSystemAccessRule" /> class using the name of a user account, a value that specifies the type of operation associated with the access rule, and a value that describes whether to allow or deny the operation. </summary>
/// <param name="identity">The name of a user account.</param>
/// <param name="fileSystemRights">One of the <see cref="T:System.Security.AccessControl.FileSystemRights" /> values that specifies the type of operation associated with the access rule. </param>
/// <param name="type">One of the <see cref="T:System.Security.AccessControl.AccessControlType" /> values that specifies whether to allow or deny the operation.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="identity" /> parameter is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">An incorrect enumeration was passed to the <paramref name="type " />parameter.</exception>
// Token: 0x06002D4D RID: 11597 RVA: 0x00093918 File Offset: 0x00091B18
public FileSystemAccessRule(string identity, FileSystemRights fileSystemRights, AccessControlType type)
: this(new SecurityIdentifier(identity), fileSystemRights, InheritanceFlags.None, PropagationFlags.None, type)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.AccessControl.FileSystemAccessRule" /> class using a reference to a user account, a value that specifies the type of operation associated with the access rule, a value that determines how rights are inherited, a value that determines how rights are propagated, and a value that specifies whether to allow or deny the operation.</summary>
/// <param name="identity">An <see cref="T:System.Security.Principal.IdentityReference" /> object that encapsulates a reference to a user account.</param>
/// <param name="fileSystemRights">One of the <see cref="T:System.Security.AccessControl.FileSystemRights" /> values that specifies the type of operation associated with the access rule.</param>
/// <param name="inheritanceFlags">One of the <see cref="T:System.Security.AccessControl.InheritanceFlags" /> values that specifies how access masks are propagated to child objects.</param>
/// <param name="propagationFlags">One of the <see cref="T:System.Security.AccessControl.PropagationFlags" /> values that specifies how Access Control Entries (ACEs) are propagated to child objects.</param>
/// <param name="type">One of the <see cref="T:System.Security.AccessControl.AccessControlType" /> values that specifies whether to allow or deny the operation.</param>
/// <exception cref="T:System.ArgumentException">The <paramref name="identity" /> parameter is not an <see cref="T:System.Security.Principal.IdentityReference" /> object.</exception>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="identity" /> parameter is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">An incorrect enumeration was passed to the <paramref name="type " />parameter.-or-An incorrect enumeration was passed to the <paramref name="inheritanceFlags " />parameter.-or-An incorrect enumeration was passed to the <paramref name="propagationFlags " />parameter.</exception>
// Token: 0x06002D4E RID: 11598 RVA: 0x0009392C File Offset: 0x00091B2C
public FileSystemAccessRule(IdentityReference identity, FileSystemRights fileSystemRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
: base(identity, (int)fileSystemRights, false, inheritanceFlags, propagationFlags, type)
{
this.rights = fileSystemRights;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.AccessControl.FileSystemAccessRule" /> class using the name of a user account, a value that specifies the type of operation associated with the access rule, a value that determines how rights are inherited, a value that determines how rights are propagated, and a value that specifies whether to allow or deny the operation.</summary>
/// <param name="identity">The name of a user account.</param>
/// <param name="fileSystemRights">One of the <see cref="T:System.Security.AccessControl.FileSystemRights" /> values that specifies the type of operation associated with the access rule.</param>
/// <param name="inheritanceFlags">One of the <see cref="T:System.Security.AccessControl.InheritanceFlags" /> values that specifies how access masks are propagated to child objects.</param>
/// <param name="propagationFlags">One of the <see cref="T:System.Security.AccessControl.PropagationFlags" /> values that specifies how Access Control Entries (ACEs) are propagated to child objects.</param>
/// <param name="type">One of the <see cref="T:System.Security.AccessControl.AccessControlType" /> values that specifies whether to allow or deny the operation.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="identity" /> parameter is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">An incorrect enumeration was passed to the <paramref name="type " />parameter.-or-An incorrect enumeration was passed to the <paramref name="inheritanceFlags " />parameter.-or-An incorrect enumeration was passed to the <paramref name="propagationFlags " />parameter.</exception>
// Token: 0x06002D4F RID: 11599 RVA: 0x00093944 File Offset: 0x00091B44
public FileSystemAccessRule(string identity, FileSystemRights fileSystemRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
: this(new SecurityIdentifier(identity), fileSystemRights, inheritanceFlags, propagationFlags, type)
{
}
/// <summary>Gets the <see cref="T:System.Security.AccessControl.FileSystemRights" /> flags associated with the current <see cref="T:System.Security.AccessControl.FileSystemAccessRule" /> object.</summary>
/// <returns>The <see cref="T:System.Security.AccessControl.FileSystemRights" /> flags associated with the current <see cref="T:System.Security.AccessControl.FileSystemAccessRule" /> object.</returns>
// Token: 0x170008DF RID: 2271
// (get) Token: 0x06002D50 RID: 11600 RVA: 0x00093958 File Offset: 0x00091B58
public FileSystemRights FileSystemRights
{
get
{
return this.rights;
}
}
// Token: 0x040011DE RID: 4574
private FileSystemRights rights;
}
}