WoWeh
WoWeh

Reputation: 106

How to get the ACC folder structure if you only have permissions to a child folder?

When using 3-legged authentication, and a user only has permissions to a child folder, the hubs/:hub_id/projects/:project_id/topFolders endpoint only returns the child folder, not the parent folders ("Project Files" etc...).
Because of that, we can't show a tree like in ACC, where the parent folders (where the user doesn't have permissions) are grayed out.

When using 2-legged authentication, without user context, we get all folders, as expected.
You can observe the same behaviour in the VSCode APS extension.

I guess a workaround is to request the folders twice, ones with and once without user context, and then combine the results.
But I wonder if I missed an API, or a parameter, which returns folders as shown in ACC.

Upvotes: 1

Views: 145

Answers (1)

WoWeh
WoWeh

Reputation: 106

Oops, sorry, my bad, RTFM.

The information is actually contained in the response.
See:
https://aps.autodesk.com/en/docs/data/v2/reference/http/hubs-hub_id-projects-project_id-topFolders-GET/#body-structure-200
data > attributes > extension > data > folderParents

Upvotes: 1

Related Questions