🛂(back) restrict ask for access to root documents
In a first version we want to restrict the ask for access feature only to root document. We will work on opening to all documents when iherited permissions will be implemented.
This commit is contained in:
committed by
Anthony LC
parent
82f2cb59e6
commit
95838e332c
@@ -1910,7 +1910,8 @@ class DocumentAskForAccessViewSet(
|
||||
if self._document is None:
|
||||
try:
|
||||
self._document = models.Document.objects.get(
|
||||
pk=self.kwargs["resource_id"]
|
||||
pk=self.kwargs["resource_id"],
|
||||
depth=1,
|
||||
)
|
||||
except models.Document.DoesNotExist as e:
|
||||
raise drf.exceptions.NotFound("Document not found.") from e
|
||||
|
||||
Reference in New Issue
Block a user