Hey,
I've been interacting with a number of end points and I'm trying to rely upon the permissions dropbox has defined in RBAC when knowing whether a user can use a number of files returned from a search.
Currently i'm polling for event changes using https://api.dropboxapi.com/2/files/list_folder
What i'm wanting to do is store the `shared_parent_id` / `shared_id` associated with that file/folder so that when it comes to searching I can compare those id's with a list of names spaces an individual has access to so that I can filter out files that individual can access and return them from elastic search.
Staring with a user email:
-
On request to get things we get the list of all members using https://api.dropboxapi.com/2/team/members/list_v2
-
Get the team_member_id when the email matches
-
Call https://api.dropboxapi.com/2/users/get_current_account using the Dropbox-API-Select-User with the team_member_id to get the root_namespace_id
-
Call https://api.dropboxapi.com/2/files/list_folder using the Dropbox-API-Select-User with the team_member_id and the Dropbox-API-Path-Root with the root_namespace_id to get a list of namespaces the user currently can access.
The problem i've noticed is that if there is:
- If User A has Access to FOLDER A as a namespace, if FOLDER A/FOLDER B is a separate namespace it’s shared_id will be different to FOLDER A so how can we when polling for an event whereFOLDER A/FOLDER B/example.txt is created confirm whether User A should have access or not.
I've seen that I could call https://api.dropboxapi.com/2/files/list_folder recursively too see all they have access to but the amount of files to do that on the fly isn't a performant feasibility. So my overall question - Is there a way of just getting a list of namespaces a user has access to not just the root? Or alternatively is there a better way of achieving this?