Forum Discussion

micha80's avatar
micha80
Expert
10 years ago

rest vs restadmin API Call

Hi,

 

I've detected an issue on our platform which I do not realy understand I am making the following call: /restapi/vc/categories/id/Forum/solutions/count

 

I get two different numbers depending on logged in or not. For example:

 

Logged in as admin/moderator: Result is 141

Logged in as a normal user or not logged in: Result is 0

 

Why do I get different results depending on the user role?

 

For now I am making the call using the restadmin function but somewhere I read this is not recommended.

 

Is there some misconfiguration on our platform?

 

Many thanks,

Michael

  • What you have caught is actually a permission related stuff. If you notice this on default widgets as well on lithosphere, the values change in log out and login state. What it does is when you make a admin call, it pulls data from all the private areas as well, but when you make a call as a normal user, it only fetch data from public areas.

  • What you have caught is actually a permission related stuff. If you notice this on default widgets as well on lithosphere, the values change in log out and login state. What it does is when you make a admin call, it pulls data from all the private areas as well, but when you make a call as a normal user, it only fetch data from public areas.

    • micha80's avatar
      micha80
      Expert

      Ok. Sounds like this is a normal behavior.

       

      Many thanks,

      Michael