Require the document view permission to view the details of a trashed document.

Add a get method override to document the API endpoint.

Signed-off-by: Michael Price <loneviking72@gmail.com>
This commit is contained in:
Michael Price
2018-02-22 02:44:36 -04:00
committed by Roberto Rosario
parent 54e8f85def
commit 68c572bd6e

View File

@@ -57,7 +57,8 @@ class APIDeletedDocumentView(generics.RetrieveDestroyAPIView):
"""
mayan_object_permissions = {
'DELETE': (permission_document_delete,)
'DELETE': (permission_document_delete,),
'GET': (permission_document_view,)
}
permission_classes = (MayanPermission,)
queryset = Document.trash.all()
@@ -70,6 +71,13 @@ class APIDeletedDocumentView(generics.RetrieveDestroyAPIView):
return super(APIDeletedDocumentView, self).delete(*args, **kwargs)
def get(self, *args, **kwargs):
"""
Retreive the details of the trashed document.
"""
return super(APIDeletedDocumentView, self).get(*args, **kwargs)
class APIDeletedDocumentRestoreView(generics.GenericAPIView):
"""