Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AccessRule.cs
Go to the documentation of this file.
2
4
5public class AccessRule<T> : AccessRule where T : struct
6{
7 public T Rights => (T)(object)base.AccessMask;
8
10 : this(identity, (int)(object)rights, isInherited: false, InheritanceFlags.None, PropagationFlags.None, type)
11 {
12 }
13
14 public AccessRule(string identity, T rights, AccessControlType type)
15 : this((IdentityReference)new NTAccount(identity), (int)(object)rights, isInherited: false, InheritanceFlags.None, PropagationFlags.None, type)
16 {
17 }
18
19 public AccessRule(IdentityReference identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
20 : this(identity, (int)(object)rights, isInherited: false, inheritanceFlags, propagationFlags, type)
21 {
22 }
23
24 public AccessRule(string identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
25 : this((IdentityReference)new NTAccount(identity), (int)(object)rights, isInherited: false, inheritanceFlags, propagationFlags, type)
26 {
27 }
28
29 internal AccessRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
30 : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, type)
31 {
32 }
33}
34public abstract class AccessRule : AuthorizationRule
35{
36 private readonly AccessControlType _type;
37
39
40 protected AccessRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
41 : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags)
42 {
43 if (type != 0 && type != AccessControlType.Deny)
44 {
46 }
47 if ((inheritanceFlags < InheritanceFlags.None) || inheritanceFlags > (InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit))
48 {
49 throw new ArgumentOutOfRangeException("inheritanceFlags", System.SR.Format(System.SR.Argument_InvalidEnumValue, inheritanceFlags, "InheritanceFlags"));
50 }
51 if ((propagationFlags < PropagationFlags.None) || propagationFlags > (PropagationFlags.NoPropagateInherit | PropagationFlags.InheritOnly))
52 {
53 throw new ArgumentOutOfRangeException("propagationFlags", System.SR.Format(System.SR.Argument_InvalidEnumValue, inheritanceFlags, "PropagationFlags"));
54 }
55 _type = type;
56 }
57}
static string ArgumentOutOfRange_Enum
Definition SR.cs:18
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Argument_InvalidEnumValue
Definition SR.cs:18
Definition SR.cs:7
AccessRule(string identity, T rights, AccessControlType type)
Definition AccessRule.cs:14
AccessRule(IdentityReference identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
Definition AccessRule.cs:19
readonly AccessControlType _type
Definition AccessRule.cs:36
AccessRule(string identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
Definition AccessRule.cs:24
AccessRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
Definition AccessRule.cs:29
AccessRule(IdentityReference identity, T rights, AccessControlType type)
Definition AccessRule.cs:9