Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AccessMaskFromRights()

static int System.Security.AccessControl.FileSystemAccessRule.AccessMaskFromRights ( FileSystemRights fileSystemRights,
AccessControlType controlType )
inlinestaticpackage

Definition at line 34 of file FileSystemAccessRule.cs.

35 {
36 if (fileSystemRights < (FileSystemRights)0 || fileSystemRights > FileSystemRights.FullControl)
37 {
38 throw new ArgumentOutOfRangeException("fileSystemRights", System.SR.Format(System.SR.Argument_InvalidEnumValue, fileSystemRights, "FileSystemRights"));
39 }
40 switch (controlType)
41 {
42 case AccessControlType.Allow:
43 fileSystemRights |= FileSystemRights.Synchronize;
44 break;
45 case AccessControlType.Deny:
46 if (fileSystemRights != FileSystemRights.FullControl && fileSystemRights != (FileSystemRights.Modify | FileSystemRights.ChangePermissions | FileSystemRights.TakeOwnership | FileSystemRights.Synchronize))
47 {
48 fileSystemRights &= ~FileSystemRights.Synchronize;
49 }
50 break;
51 }
52 return (int)fileSystemRights;
53 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Argument_InvalidEnumValue
Definition SR.cs:18
Definition SR.cs:7

References System.SR.Argument_InvalidEnumValue, and System.SR.Format().

Referenced by System.Security.AccessControl.FileSystemSecurity.RemoveAccessRule(), and System.Security.AccessControl.FileSystemSecurity.RemoveAccessRuleSpecific().