This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user