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

95 lines
8.9 KiB
C#

using System;
using System.Security.Principal;
namespace System.Security.AccessControl
{
/// <summary>Represents a set of access rights allowed or denied for a user or group. This class cannot be inherited.</summary>
// Token: 0x020004DA RID: 1242
public sealed class RegistryAccessRule : AccessRule
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.AccessControl.RegistryAccessRule" /> class, specifying the user or group the rule applies to, the access rights, and whether the specified access rights are allowed or denied.</summary>
/// <param name="identity">The user or group the rule applies to. Must be of type <see cref="T:System.Security.Principal.SecurityIdentifier" /> or a type such as <see cref="T:System.Security.Principal.NTAccount" /> that can be converted to type <see cref="T:System.Security.Principal.SecurityIdentifier" />.</param>
/// <param name="registryRights">A bitwise combination of <see cref="T:System.Security.AccessControl.RegistryRights" /> values indicating the rights allowed or denied.</param>
/// <param name="type">One of the <see cref="T:System.Security.AccessControl.AccessControlType" /> values indicating whether the rights are allowed or denied.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="registryRights" /> specifies an invalid value.-or-<paramref name="type" /> specifies an invalid value.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="identity" /> is null. -or-<paramref name="eventRights" /> is zero.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="identity" /> is neither of type <see cref="T:System.Security.Principal.SecurityIdentifier" /> nor of a type such as <see cref="T:System.Security.Principal.NTAccount" /> that can be converted to type <see cref="T:System.Security.Principal.SecurityIdentifier" />.</exception>
// Token: 0x06002E1E RID: 11806 RVA: 0x00094298 File Offset: 0x00092498
public RegistryAccessRule(IdentityReference identity, RegistryRights registryRights, AccessControlType type)
: this(identity, registryRights, InheritanceFlags.None, PropagationFlags.None, type)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.AccessControl.RegistryAccessRule" /> class, specifying the name of the user or group the rule applies to, the access rights, and whether the specified access rights are allowed or denied.</summary>
/// <param name="identity">The name of the user or group the rule applies to.</param>
/// <param name="registryRights">A bitwise combination of <see cref="T:System.Security.AccessControl.RegistryRights" /> values indicating the rights allowed or denied.</param>
/// <param name="type">One of the <see cref="T:System.Security.AccessControl.AccessControlType" /> values indicating whether the rights are allowed or denied.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="registryRights" /> specifies an invalid value.-or-<paramref name="type" /> specifies an invalid value.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="registryRights" /> is zero.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="identity" /> is null.-or-<paramref name="identity" /> is a zero-length string.-or-<paramref name="identity" /> is longer than 512 characters.</exception>
// Token: 0x06002E1F RID: 11807 RVA: 0x000942A8 File Offset: 0x000924A8
public RegistryAccessRule(string identity, RegistryRights registryRights, AccessControlType type)
: this(new SecurityIdentifier(identity), registryRights, type)
{
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.AccessControl.RegistryAccessRule" /> class, specifying the user or group the rule applies to, the access rights, the inheritance flags, the propagation flags, and whether the specified access rights are allowed or denied.</summary>
/// <param name="identity">The user or group the rule applies to. Must be of type <see cref="T:System.Security.Principal.SecurityIdentifier" /> or a type such as <see cref="T:System.Security.Principal.NTAccount" /> that can be converted to type <see cref="T:System.Security.Principal.SecurityIdentifier" />.</param>
/// <param name="registryRights">A bitwise combination of <see cref="T:System.Security.AccessControl.RegistryRights" /> values specifying the rights allowed or denied.</param>
/// <param name="inheritanceFlags">A bitwise combination of <see cref="T:System.Security.AccessControl.InheritanceFlags" /> flags specifying how access rights are inherited from other objects.</param>
/// <param name="propagationFlags">A bitwise combination of <see cref="T:System.Security.AccessControl.PropagationFlags" /> flags specifying how access rights are propagated to other objects.</param>
/// <param name="type">One of the <see cref="T:System.Security.AccessControl.AccessControlType" /> values specifying whether the rights are allowed or denied.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="registryRights" /> specifies an invalid value.-or-<paramref name="type" /> specifies an invalid value.-or-<paramref name="inheritanceFlags" /> specifies an invalid value.-or-<paramref name="propagationFlags" /> specifies an invalid value.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="identity" /> is null.-or-<paramref name="registryRights" /> is zero.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="identity" /> is neither of type <see cref="T:System.Security.Principal.SecurityIdentifier" />, nor of a type such as <see cref="T:System.Security.Principal.NTAccount" /> that can be converted to type <see cref="T:System.Security.Principal.SecurityIdentifier" />.</exception>
// Token: 0x06002E20 RID: 11808 RVA: 0x000942B8 File Offset: 0x000924B8
public RegistryAccessRule(IdentityReference identity, RegistryRights registryRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
: base(identity, 0, false, inheritanceFlags, propagationFlags, type)
{
this.rights = registryRights;
}
/// <summary>Initializes a new instance of the <see cref="T:System.Security.AccessControl.RegistryAccessRule" /> class, specifying the name of the user or group the rule applies to, the access rights, the inheritance flags, the propagation flags, and whether the specified access rights are allowed or denied.</summary>
/// <param name="identity">The name of the user or group the rule applies to.</param>
/// <param name="registryRights">A bitwise combination of <see cref="T:System.Security.AccessControl.RegistryRights" /> values indicating the rights allowed or denied.</param>
/// <param name="inheritanceFlags">A bitwise combination of <see cref="T:System.Security.AccessControl.InheritanceFlags" /> flags specifying how access rights are inherited from other objects.</param>
/// <param name="propagationFlags">A bitwise combination of <see cref="T:System.Security.AccessControl.PropagationFlags" /> flags specifying how access rights are propagated to other objects.</param>
/// <param name="type">One of the <see cref="T:System.Security.AccessControl.AccessControlType" /> values specifying whether the rights are allowed or denied.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="registryRights" /> specifies an invalid value.-or-<paramref name="type" /> specifies an invalid value.-or-<paramref name="inheritanceFlags" /> specifies an invalid value.-or-<paramref name="propagationFlags" /> specifies an invalid value.</exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="eventRights" /> is zero.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="identity" /> is null.-or-<paramref name="identity" /> is a zero-length string.-or-<paramref name="identity" /> is longer than 512 characters.</exception>
// Token: 0x06002E21 RID: 11809 RVA: 0x000942D0 File Offset: 0x000924D0
public RegistryAccessRule(string identity, RegistryRights registryRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
: this(new SecurityIdentifier(identity), registryRights, inheritanceFlags, propagationFlags, type)
{
}
/// <summary>Gets the rights allowed or denied by the access rule.</summary>
/// <returns>A bitwise combination of <see cref="T:System.Security.AccessControl.RegistryRights" /> values indicating the rights allowed or denied by the access rule.</returns>
// Token: 0x17000922 RID: 2338
// (get) Token: 0x06002E22 RID: 11810 RVA: 0x000942E4 File Offset: 0x000924E4
public RegistryRights RegistryRights
{
get
{
return this.rights;
}
}
// Token: 0x04001229 RID: 4649
private RegistryRights rights;
}
}