Forum Discussion

tonongregory's avatar
10 years ago

Metrics REST API for anonymous users

Hello,

 

I would like to display metrics information to all users of a community, regardless of roles. Typically the number of solutions accepted this week or the number of ideas posted during the last month.

 

I granted the following permissions:

  • Allow user to make REST API calls with read access
  • Allow user to access metrics

 

But it doesn't work if I don't also grant the Update Communities permission, which I obviously don't want to for anonymous users.

 

Why is this permission required?

Do you have a solution for my use case, ie allowing calls to the metrics API for non logged users? 

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)

    Hi tonongregory 

     

    for the first part of your query (why is required) I suggest to get in touch with our Support team so that this is formally reviewed by our product teams.

     

    For the second part, what I would suggest as a workaround is to create an endpoint that encapsulates these metrics calls using the restadmin context object so that the permission is not checked. Things to be aware of in this case:

    • You would be running the rest call as if you were an administrator, so I would suggest to use this to read data (not to write data)
    • In certain context, these metrics call may include info from private boards (because you are calling as an admin, so if you do that at the root community level it could include metrics from private boards for example)

    Hope it helps,