This commit is contained in:
@@ -17,9 +17,9 @@ namespace AyaNova.Biz
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 (!searchParameters.NameOnly)
|
||||
{
|
||||
//list to hold temporary matches
|
||||
List<AyaTypeId> CanReadMatchingObjects = new List<AyaTypeId>();
|
||||
foreach (AyaTypeId t in MatchingObjects)
|
||||
{
|
||||
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
|
||||
//TODO: change this to use MatchingObjects list instead
|
||||
// foreach (SearchKey SearchKeyMatch in SearchKeyMatches)
|
||||
// {
|
||||
// SearchResult SR = new SearchResult();
|
||||
// SR.Name = BizObjectNameFetcher.Name(SearchKeyMatch.ObjectType, SearchKeyMatch.ObjectId, ct);
|
||||
// SR.Id = SearchKeyMatch.ObjectId;
|
||||
// SR.Type = SearchKeyMatch.ObjectType;
|
||||
// ResultList.Add(SR);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
//Build the return list from the remaining matching objects list
|
||||
foreach (AyaTypeId i in MatchingObjects)
|
||||
{
|
||||
SearchResult SR = new SearchResult();
|
||||
SR.Name = BizObjectNameFetcher.Name(i, ct);
|
||||
SR.Id = i.ObjectId;
|
||||
SR.Type = i.ObjectType;
|
||||
ResultList.Add(SR);
|
||||
}
|
||||
|
||||
return ResultList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user