This commit is contained in:
2018-09-20 19:07:33 +00:00
parent 5c01bbfe0f
commit e6637e6f16
2 changed files with 87 additions and 6 deletions

View File

@@ -98,7 +98,7 @@ namespace AyaNova.Biz
}
//Class to hold search result
//Class to hold search result returned to client
public class SearchResult
{
public string Name { get; set; }
@@ -106,10 +106,19 @@ namespace AyaNova.Biz
public long Id { get; set; }
}
// //Class to hold temporary matches during processing
// public class MatchingObject
// {
// public bool NameMatch { get; set; }
// public bool TagMatch { get; set; }
// public AyaTypeId TypeAndId { get; set; }
// }
public static async Task<List<SearchResult>> DoSearch(AyContext ct, long localeId, SearchRequestParameters searchParameters)
public static async Task<List<SearchResult>> DoSearch(AyContext ct, long localeId, AuthorizationRoles currentUserRoles, SearchRequestParameters searchParameters)
{
List<SearchResult> ResultList = new List<SearchResult>();
@@ -289,9 +298,18 @@ namespace AyaNova.Biz
}
//REMOVE ANY ITEMS THAT USER IS NOT PERMITTED TO READ
foreach (AyaTypeId t in MatchingObjects)
//If it's a name only search then all is allowed
//If it's not a name only search then rights need to be checked for full read because even if it's just a tags search that's part of the full record of the object
if (!searchParameters.NameOnly)
{
foreach (AyaTypeId t in MatchingObjects)
{
if (AyaNova.Api.ControllerHelpers.Authorized.IsAuthorizedToReadFullRecord(currentUserRoles, t.ObjectType))
{
}
}
}