Include permissions for suggestions

This commit is contained in:
shamoon
2023-04-15 22:47:36 -07:00
parent 0f92523d28
commit 52e8a1aba3
3 changed files with 55 additions and 13 deletions

View File

@@ -401,12 +401,16 @@ class DocumentViewSet(
return Response(
{
"correspondents": [c.id for c in match_correspondents(doc, classifier)],
"tags": [t.id for t in match_tags(doc, classifier)],
"document_types": [
dt.id for dt in match_document_types(doc, classifier)
"correspondents": [
c.id for c in match_correspondents(doc, classifier, request.user)
],
"tags": [t.id for t in match_tags(doc, classifier, request.user)],
"document_types": [
dt.id for dt in match_document_types(doc, classifier, request.user)
],
"storage_paths": [
dt.id for dt in match_storage_paths(doc, classifier, request.user)
],
"storage_paths": [dt.id for dt in match_storage_paths(doc, classifier)],
"dates": [
date.strftime("%Y-%m-%d") for date in dates if date is not None
],