Data Explorer / Discourse API issues

  1. Is there any way to make a Data Explorer query accessible via the Discourse API without making the user associated with the API key an admin? (From my experimentation, it seems all API queries are of the form “/admin/plugins/explorer/queries/NNN/run” and non-admins do not appear to have access to “/admin” and below.)

  2. In the Data Explorer UI, I have “Allow groups to access this query” set to a specific group. Despite this, I’ve found that admin users that are not members of the group still have access. Is this expected?

Many thanks in advance!

1 Like

You can allow groups to access a query as you noticed… when this is enabled a non-admin member of a group can access a query from g/{groupname}/reports/{id}

this is expected, admins can access everything

3 Likes

Hi! Thanks for the quick response!

  1. I’m aware that the g/{groupname}/reports/{id} URL works for users interactively logged into the Discourse site. However, using cURL to call the Discourse API using URLs of that format does not work. I’ve tried a wide variety of user types, groups and API key settings and none worked. In the hopes of eliminating as many factors as possible, I tried with an API key that has no scopes configured (I assume this means its wide open) and associated that key with an admin user (who’s a member of the group that the Data Explorer query references) and I get an HTML page in response that says “Oops! That page doesn’t exist or is private.”

  2. Thanks for confirming that admins can access everything. I suspected as much.

Thanks again!