| | 1 | | using SharpHoundCommonLib.Enums; |
| | 2 | |
|
| | 3 | | namespace SharpHoundCommonLib.OutputTypes |
| | 4 | | { |
| | 5 | | public class ACE |
| | 6 | | { |
| 61 | 7 | | public string PrincipalSID { get; set; } |
| 59 | 8 | | public Label PrincipalType { get; set; } |
| 68 | 9 | | public string RightName { get; set; } |
| 59 | 10 | | public bool IsInherited { get; set; } |
| | 11 | |
|
| | 12 | | public override string ToString() |
| 1 | 13 | | { |
| 1 | 14 | | return $"{PrincipalType} {PrincipalSID} - {RightName} {(IsInherited ? "" : "Not")} Inherited"; |
| 1 | 15 | | } |
| | 16 | |
|
| | 17 | | protected bool Equals(ACE other) |
| 0 | 18 | | { |
| 0 | 19 | | return PrincipalSID == other.PrincipalSID && PrincipalType == other.PrincipalType && |
| 0 | 20 | | RightName == other.RightName && IsInherited == other.IsInherited; |
| 0 | 21 | | } |
| | 22 | |
|
| | 23 | | public override bool Equals(object obj) |
| 0 | 24 | | { |
| 0 | 25 | | if (ReferenceEquals(null, obj)) return false; |
| 0 | 26 | | if (ReferenceEquals(this, obj)) return true; |
| 0 | 27 | | if (obj.GetType() != GetType()) return false; |
| 0 | 28 | | return Equals((ACE) obj); |
| 0 | 29 | | } |
| | 30 | |
|
| | 31 | | public override int GetHashCode() |
| 0 | 32 | | { |
| | 33 | | unchecked |
| 0 | 34 | | { |
| 0 | 35 | | var hashCode = PrincipalSID != null ? PrincipalSID.GetHashCode() : 0; |
| 0 | 36 | | hashCode = (hashCode * 397) ^ (int) PrincipalType; |
| 0 | 37 | | hashCode = (hashCode * 397) ^ (RightName != null ? RightName.GetHashCode() : 0); |
| 0 | 38 | | hashCode = (hashCode * 397) ^ IsInherited.GetHashCode(); |
| 0 | 39 | | return hashCode; |
| | 40 | | } |
| 0 | 41 | | } |
| | 42 | | } |
| | 43 | | } |