embedding-api-v3-guide
embedding-api-v3-guide copied to clipboard
Permissions Retrieval for Toolbar Interactions
Will we be able to determine permissions for toolbar actions?
A lot of people (myself included) extrapolate the toolbar UI elements into their application. However determining what level of access people have through the REST API is very circuitous as permissions need to be checked against every level (project, workbook, view) and may not necessarily be user-specific.
In my opinion this would ideally be handled by the REST API*. However, if that's not viable a quick call to determine the availability of certain functions would be fantastic.
*My REST API suggestion would be either to
- Add permission as an optional response included in the call:
GET /api/api-version/sites/site-id/users/user-id/workbooks
or - Add a separate API endpoint for permission retrieval that resolves to the user in question rather than the object in question
yeah this request makes sense and isn't something I've thought of before: If you are doing toolbar functionality in your embedded app, you want to know what the user has permissions for. Why do you want this in the REST API rather than the JSAPI, though?
First, I should clarify - I mentioned toolbar permissions here, but that should probably just be expanded to all permissions on a viz:
For the REST API, I figured architecturally it would be simpler to slightly modify the permissions calls from the REST API rather than build a net-new feature in the JS API. Also from a performance perspective the REST API can be easily cached server-side on an app, or can also be called prior to onFirstInteractive() which speeds up some load time while the viz is loading.
But if this were to go into the JS API, like viz.getPermissions() it would still definitely achieve the same goal, so definitely happy wherever it lands, but I'd have a slight preference on the REST API.