Backendless Support
 
Answered

User has no permissions for specified resource

Hi,

I am trying to upload an image via android app I am developing. I tried:

Backendless.Files.Android.upload(bitmap1, Bitmap.CompressFormat.JPEG, 100,

myuserid+".jpg",

"images/IDs", new AsyncCallback<BackendlessFile>()

This gives error User has no permissions for specified resourceI made sure the user is authenticated before I call above function,Also I checked the user permission is allowing this

any help is very great appreciated.see the attached permission roles from the specified pathThanks,Mohammed

Leave a Comment

Comments (6)

photo
1

Hi Mohammed

What is your application id?

Anton

photo
1

Hi Anton,

F441DB77-D6BC-BD8A-FF1F-1E44AEE38900

photo
1

Mohammed,

I see that `deny` permissions are set for NotAuthenticatedUser role. That is causing errors you get https://prnt.sc/ie0p3t

photo
1

Thank you Anton,

but I logged in before I tried to upload the image. Also, when I try to upload the image to parent folder "images" it works

not sure but may be the way I assign the path has to do with it: I use images/IDs

please advise

Thanks,

photo
1

Hi Anton,

Update:

I was able to fix it. initially the sequence of calls in my app is:

user registers then logged in then upload the image

I put each call in a separate function, and from main module in my app I call each them one after the other, but I forgot to check if the call was completed before I call the next one.

So, what I did, I am calling the next call from inside the success result from the previous call like:

Backendless.UserService.register (user,pass, new AsyncCallback<BackendlessUser>(){

@Override

public void handleResponse(BackendlessUser backendlessUser) { call the logging in function ...and from the logging function , the success part , I upload the image

Thanks for the hint in the last post you put

Mohammed

photo
1

Glad you solved it)

Anton