GrantAccessOnDoc exception : docId not found

0 votes

Hi,

i want to ask about the ACL scenario.

in documentation

 Once ACL enablement is done for your app, now whenever a call is made for user data, it should come from authenticated user.(Click to know about how to do User Authentication ?). If request contains AdminKey it would be considered as administrative call and would have access to all app data. If it is coming from user and does not contain AdminKey, it would be checked for access on target resource. If user is authorized to access the resource, it will succeed otherwise Unauthorized Exception will be thrown.

i'm trying to give an access write to user on document using AdminKey. and trying to update the doc : 

 

com.shephertz.app42.paas.sdk.java.App42NotFoundException: {\"app42Fault\":{\"httpErrorCode\":404,\"appErrorCode\":2600,\"message\":\"Not Found\",\"details\":\"Document by the Id '53a673dee4b05552fd5c6341' does not exist.\"}}","state":"readmail"}

 

first trial, i'm using key management on App42 console with access to ALL using adminKey. and the exception trigerred.

so i'm using ApiKey and SecretKey from my game. and set up storage service using adminKey too.

but the exception still trigerred.

it seems the acl of doc doesnt change at all.

this is storage response about the doc : 

 

{\"app42\":{\"response\":{\"success\":true,\"storage\":{\"dbName\":\"DataGame\",\"collectionName\":\"MailBox\",\"jsonDoc\":{\"_id\":{\"$oid\":\"53a673dee4b05552fd5c6341\"},\"sentAt\":\"2014-06-22 13:12:45\",\"fromId\":\"5345c3e4e4b0e41dba29a7c1\",\"mailData\":{\"subject\":\"re:Tes o\",\"gold\":0,\"msg\":\"vbzjjw2929\\n\\nhcjd893\",\"Att2\":\"\",\"Att1\":\"\"},\"toName\":\"unit0001\",\"toId\":\"531ca98ce4b036d697027963\",\"mailId\":\"1403443454013.872\",\"_$owner\":{\"owner\":\"shendyaprianto\"},\"_$acl\":[{\"PUBLIC\":\"R\"}],\"_$createdAt\":\"2014-06-22T06:12:46.003Z\",\"fromName\":\"shooter0001\",\"_$updatedAt\":\"2014-06-22T06:12:46.003Z\"}}}}}","state":"readmail"}

any suggestion?

 

thanks

 

-Solved-

reason : i forgot to set the new acl on the list. my bad

closed with the note: i forgot to set the new acl on the list. my bad
asked Jun 22, 2014 in App42 Cloud API-BaaS by goldglorygirl (55 points)
closed Jun 22, 2014 by goldglorygirl
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...