| 1234567891011121314151617181920212223242526272829303132 |
- using System.Collections.Generic;
- namespace IwbZero.Authorization.Base.Permissions
- {
- internal class DataPermissionNameComparer : IEqualityComparer<string>
- {
- public static DataPermissionNameComparer Instance => new DataPermissionNameComparer();
- public bool Equals(string x, string y)
- {
- if (string.IsNullOrEmpty(x) && string.IsNullOrEmpty(y))
- {
- return true;
- }
- if (string.IsNullOrEmpty(x) || string.IsNullOrEmpty(y))
- {
- return false;
- }
- if (x.EndsWith($"@{(int)OperType.All}"))
- {
- return true;
- }
- return x == y;
- }
- public int GetHashCode(string obj)
- {
- return obj.GetHashCode();
- }
- }
- }
|