This commit is contained in:
@@ -69,7 +69,7 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
|
||||
public static async Task<SearchReturnObject> DoSearchAsync(AyContext ct, long translationId, AuthorizationRoles currentUserRoles, SearchRequestParameters searchParameters)
|
||||
public static async Task<SearchReturnObject> DoSearchAsync(AyContext ct, long translationId, AuthorizationRoles currentUserRoles, long currentUserId, SearchRequestParameters searchParameters)
|
||||
{
|
||||
var ReturnObject = new SearchReturnObject();
|
||||
|
||||
@@ -185,6 +185,12 @@ namespace AyaNova.Biz
|
||||
CanReadMatchingObjects.Add(new AyaTypeId(f.AttachToObjectType, f.AttachToObjectId));
|
||||
}
|
||||
}
|
||||
else if (t.ObjectType == AyaType.Memo)
|
||||
{
|
||||
//Users are only permitted to search their own memo's
|
||||
if (await ct.Memo.AsNoTracking().AnyAsync(z => z.Id == t.ObjectId && z.ToId == currentUserId))
|
||||
CanReadMatchingObjects.Add(t);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(currentUserRoles, t.ObjectType))
|
||||
|
||||
Reference in New Issue
Block a user