Issue
For NXDRIVE-1838 to be efficient, it would be very useful to be able to fetch permissions of documents when retrieving them.
Currently, to get all children of a given parent folder, this code works well:
docs = server.documents.get_children(path="/")
But for NXDRIVE-1838, it is needed to know if the user has write access to all folderish documents. And so another call will be made for each folder:
# Peuso-code can_write = server.documents.has_permission(doc.uid, "ReadWrite")
This would explode any decent server.
Proposition
Add a new argument to Documents.API.get_children() to be able to fetch more than basic information:
def get_children(self, uid=None, path=None, enrichers=None): # type: (Optional[Text], Optional[Text], Optional[List[str]]) -> List[Document] return super(API, self).get( path=self._path(uid=uid, path=path), enrichers=enrichers, adapter="children" )
And the new call would be:
docs = server.documents.get_children(path="/", enrichers=["permissions"])
- is related to
-
NXDRIVE-1838 Allow for one time synchronization of a file (Direct Transfer)
- Resolved