public bool MatchPermissionId(string permissionId) { if (NeedCheckPermissionIds == null || NeedCheckPermissionIds.Count == 0) { return(false); } if (string.IsNullOrWhiteSpace(permissionId)) { return(false); } return(NeedCheckPermissionIds.MyContains(permissionId)); }
public PermissionCheckContext AddCheckPermissionIds(params string[] permissionIds) { if (permissionIds == null || permissionIds.Length == 0) { return(this); } foreach (var permissionId in permissionIds) { if (!NeedCheckPermissionIds.MyContains(permissionId)) { if (!string.IsNullOrWhiteSpace(permissionId)) { var splitIds = permissionId.SplitToValues().Where(x => !string.IsNullOrWhiteSpace(x)).ToList(); foreach (var splitId in splitIds) { NeedCheckPermissionIds.Add(splitId); } } } } return(this); }