get data from user collection
Ok, I fixed it, forgot to map input parameters, userid and sessionid.
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Ok, I fixed it, forgot to map input parameters, userid and sessionid.
Hi Terry,
Thank you for the update!
Hey Guys,
I'm having a similar issue. I am trying to get the user information to store locally and I have followed this thread to the letter. My RESTService works and gives me the response I'm looking for. However, when I run the app, everything is coming back "undefined." Even the debug console I am getting no errors. I am assuming I am overlooking some small detail, but I can't seem to find it. Here are some screen shots, hopefully you can help!
Hello Matthew,
Please detail, how do you install the response parameters? On tab 'Test' after the successful test of the service you should click on the "Automatically create service response" button, like this:
http://devcenter.appery.io/documentat...
That is exactly what I did and it gave me the "UserInfo Array." Prior to that I manually added the parameters.
Correction*
I just tried it again and the array went away. and now it works perfectly!!
Somehow I knew I was missing a small detail and it turns out it I didn't retrace my steps completely.
Thank you SO much for your help!
Metthew,
Thank you for the update. Do not hesitate to contact us if you need any further help.
One more question on this topic. How can I pull a user's information different from the active user? I have the service with "{database_url}/users/{_id}" as the URL, I tried "{database_url}/users/{username}" and that didn't seem to work.
Hi Matthew,
You can access to users only with "session-token" and in accordance to the "acl" item field.
So to access other users you need to update your users "acl" field to contain following value:
"*":{
"read":true,
}
Other way(using DB master key) - see details by following link: http://devcenter.appery.io/documentat...
Regards.
This is what happens by default:
{"*":{"read":true},"53aceac0e4b07420882b3f10":{"read":true,"write":true}}
I have "users" then I have "managers." The users will never have access to the user database because I have not added components to their page that call any services to the database other than their own ID. I even have the pages "check" the user's permissions on "Page Show" for any page that only a manager has access to.
So, I should be safe to set the default to what you have, correct?
Hi Matthew,
Your default is ok:
pre
{"*":{"read":true},"53aceac0e4b07420882b3f10":{"read":true,"write":true}}
/pre
In this case permision error should not appear when you call "getUser" service with correct session token.
Thus please give us screen shots on browser debugger network tab where we can see all requests parameters and request headers and what server returns to this request.
Thanks & regards.