Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AuthorizationRule.cs
Go to the documentation of this file.
2
4
5public abstract class AuthorizationRule
6{
7 private readonly IdentityReference _identity;
8
9 private readonly int _accessMask;
10
11 private readonly bool _isInherited;
12
14
16
18
19 protected internal int AccessMask => _accessMask;
20
21 public bool IsInherited => _isInherited;
22
24
26
27 protected internal AuthorizationRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
28 {
29 if (identity == null)
30 {
31 throw new ArgumentNullException("identity");
32 }
33 if (accessMask == 0)
34 {
35 throw new ArgumentException(System.SR.Argument_ArgumentZero, "accessMask");
36 }
37 if ((inheritanceFlags < InheritanceFlags.None) || inheritanceFlags > (InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit))
38 {
39 throw new ArgumentOutOfRangeException("inheritanceFlags", System.SR.Format(System.SR.Argument_InvalidEnumValue, inheritanceFlags, "InheritanceFlags"));
40 }
41 if ((propagationFlags < PropagationFlags.None) || propagationFlags > (PropagationFlags.NoPropagateInherit | PropagationFlags.InheritOnly))
42 {
43 throw new ArgumentOutOfRangeException("propagationFlags", System.SR.Format(System.SR.Argument_InvalidEnumValue, inheritanceFlags, "PropagationFlags"));
44 }
45 if (!identity.IsValidTargetType(typeof(SecurityIdentifier)))
46 {
48 }
49 _identity = identity;
50 _accessMask = accessMask;
51 _isInherited = isInherited;
52 _inheritanceFlags = inheritanceFlags;
53 if (inheritanceFlags != 0)
54 {
55 _propagationFlags = propagationFlags;
56 }
57 else
58 {
60 }
61 }
62}
static string Arg_MustBeIdentityReferenceType
Definition SR.cs:16
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Argument_ArgumentZero
Definition SR.cs:52
static string Argument_InvalidEnumValue
Definition SR.cs:18
Definition SR.cs:7
AuthorizationRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)