Back

Permission to document while signup

  • 0
  • Databases
iamdinesh
13 Mar, 2023, 12:22
TL;DR
The user is having trouble assigning permissions to a document during signup. They have changed the permission settings but still can't assign permission. The issue seems to be that the user is not authorized, causing a 401 error. One suggestion is to remove the part about giving permissions to verified users since all users should be able to read it. The user is asked to remove the permissions parameter to troubleshoot the issue. A screenshot of the payload is requested to determine the actual permissions set.
joeyouss
13 Mar, 2023, 12:23

I was about to ask for this screenshot, thanks , let me look into it

iamdinesh
13 Mar, 2023, 12:23

Flutter source code

iamdinesh
13 Mar, 2023, 12:24

Collection permission

iamdinesh
13 Mar, 2023, 12:27

I am trying to achieve is create by any, read by users and update by concern user

joeyouss
13 Mar, 2023, 12:38

Thank you for sharing

joeyouss
13 Mar, 2023, 12:49

Can you attach a screenshot of payload? It will allow us to see what permissions are actually set to

iamdinesh
13 Mar, 2023, 12:54
joeyouss
13 Mar, 2023, 13:07

Can you once remove the permissions parameter and see what the output shows? We want to try this to be able to find out the problem that is causing this

iamdinesh
13 Mar, 2023, 13:41

Without permission document gets created

joeyouss
13 Mar, 2023, 14:01

Hmm, maybe we remove the part about giving verified users the permissions? Since the error is 401 which might indicate the user trying to access this is not verified. Giving read permissions to all users on collection-level, and then only to verified on document-level won't have any effect; all users will be able to read it

iamdinesh
13 Mar, 2023, 14:30

I even tried only with update permission for user... that also leads to same error

joeyouss
13 Mar, 2023, 16:50

Oh, i see, so you're saying the user trying to access this is verified for sure?

iamdinesh
13 Mar, 2023, 17:21

This is during creation of doc I am getting this issue

iamdinesh
13 Mar, 2023, 17:22

since collection have rights for any to create document

iamdinesh
13 Mar, 2023, 17:22

after signup i am trying to store his profile details in a collection

iamdinesh
13 Mar, 2023, 17:22

since that is his profile he alone need to update it

iamdinesh
13 Mar, 2023, 17:22

others can see those information

iamdinesh
13 Mar, 2023, 17:23

Hope this clarifies the flow...

iamdinesh
13 Mar, 2023, 17:23

At the time of creation user is not logged in

iamdinesh
14 Mar, 2023, 04:50

is there any way to achieve this?

iamdinesh
14 Mar, 2023, 06:54

I have changed permission as attached so that any can create but still issue is same. Not able to assign permission to document

iamdinesh
14 Mar, 2023, 06:55
Meldiron
14 Mar, 2023, 08:31

I believe this might be the problem.

Imagine scenario with teams. You are not allowed to give permission to a team you are not part of.. If you could, you would be able to spam everyone on this team.

For same reason, un-authroized user cannot set permission to specific user. It would allow anyone to spam this user.

Solution to this is to make sure you are authroized first, then start creating documents that specific user should have permission to.

iamdinesh
14 Mar, 2023, 08:34

Ok Then I need to change flow of app... I came to this conclusion by earlier today.. Thanks for looking into it..

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more