scott-lee
(Scott Lee)
February 23, 2015, 7:25pm
1
Hello,
Although I added “user-token” header field like below, I keep getting response code 4000, permission denied.
Read, write, remove, permission are granted to all users except for NotAuthenticatedUser.
The file I tried to download is one that I uploaded.
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setURL:url];
[request setHTTPMethod:@"GET"];
[request setValue:[backendless.userService.currentUser getUserToken] forHTTPHeaderField:@"user-token"];
NSError *error;
NSURLResponse *response;
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
Am I missing anything?
Regards,
Scott
Hi Scott,
Read, write, remove, permission are granted to all users except for NotAuthenticatedUser.
Did you mean to say “granted to all roles…”?
Also, did you set the permissions specifically for the file or for the directory which contains the file you attempt to download?
Regards,
Mark
scott-lee
(Scott Lee)
February 24, 2015, 5:42am
3
Hi Mark,
Thanks for quick reply.
Yes I meant to say granted all roles permission except for roles permission for NotAuthenticatedUser.
did you set the permissions specifically for the file or for the directory which contains the file you attempt to download?
No I didn’t set roles for this file or directory, so it inherits GRANT permission from the global permission matrix.
You can take a look at attached screenshot of roles for this file.
Regards,
Scott
Hi Scott!
Please wait for our update. It will contain fix of this problem.
Regards,
Kate.
Hi Scott,
The problem has been fixed and is in QA now. We will let you know once the service had been patched with a fix.
Regards,
Mark
Hi Scott,
This issue is already resolved. Could you try it again?
Regards,
Kate.
scott-lee
(Scott Lee)
February 27, 2015, 8:40am
8
Hi Kate,
Thanks for update.
I am still getting the following response when logged in user tries to download.
{“message”:“User has no permissions to specified resource”,“code”:4000}
As explained in the article I just add one header value like below
[request setValue:[backendless.userService.currentUser getUserToken] forHTTPHeaderField:@“user-token”];
Regards,
Scott