This commit is contained in:
2018-09-20 19:11:14 +00:00
parent e6637e6f16
commit f5a85f0f6a
2 changed files with 17 additions and 17 deletions

View File

@@ -17,9 +17,9 @@ namespace AyaNova.Biz
internal static class BizObjectNameFetcher internal static class BizObjectNameFetcher
{ {
internal static string Name(AyaTypeId tid) internal static string Name(AyaTypeId tid, AyContext ct = null)
{ {
return Name(tid.ObjectType, tid.ObjectId); return Name(tid.ObjectType, tid.ObjectId, ct);
} }

View File

@@ -302,30 +302,30 @@ namespace AyaNova.Biz
//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 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) if (!searchParameters.NameOnly)
{ {
//list to hold temporary matches
List<AyaTypeId> CanReadMatchingObjects = new List<AyaTypeId>();
foreach (AyaTypeId t in MatchingObjects) foreach (AyaTypeId t in MatchingObjects)
{ {
if (AyaNova.Api.ControllerHelpers.Authorized.IsAuthorizedToReadFullRecord(currentUserRoles, t.ObjectType)) if (AyaNova.Api.ControllerHelpers.Authorized.IsAuthorizedToReadFullRecord(currentUserRoles, t.ObjectType))
{ {
CanReadMatchingObjects.Add(t);
} }
} }
//Ok, we're here with the list of allowable objects which is now the master matching objects list so...
MatchingObjects = CanReadMatchingObjects;
} }
//amost ready to return, now populate the return list //Build the return list from the remaining matching objects list
//TODO: change this to use MatchingObjects list instead foreach (AyaTypeId i in MatchingObjects)
// foreach (SearchKey SearchKeyMatch in SearchKeyMatches) {
// { SearchResult SR = new SearchResult();
// SearchResult SR = new SearchResult(); SR.Name = BizObjectNameFetcher.Name(i, ct);
// SR.Name = BizObjectNameFetcher.Name(SearchKeyMatch.ObjectType, SearchKeyMatch.ObjectId, ct); SR.Id = i.ObjectId;
// SR.Id = SearchKeyMatch.ObjectId; SR.Type = i.ObjectType;
// SR.Type = SearchKeyMatch.ObjectType; ResultList.Add(SR);
// ResultList.Add(SR); }
// }
return ResultList; return ResultList;
} }