Back

Users with a label cannot give read permission to a user with a different label

  • 1
  • Databases
  • Web
PingGhost
31 Oct, 2023, 23:52

User A with a label (x) is creating a document and wants to give read permission to user B with a label (y) while creating the document. returning 401

[ Permission.read(Role.user(B)), Permission.read(Role.user(A)), Permission.delete(Role.user(A)) ]

TL;DR
Users with a different label cannot grant read permission to each other. This is causing a 401 error. To solve this, you can create Appwrite Functions with a Server SDK to allow users to grant access to teams they are not a member of. You can find more information on how to do this in the documentation at <https://appwrite.io/docs/advanced/platform/permissions>.
PingGhost
1 Nov, 2023, 00:08

any help fellas

Drake
1 Nov, 2023, 00:44

A project user can only grant permissions to a resource that they own. For example, if a user is trying to share a document with a team that they are not a member of, they will encounter a 401 not authorized error. If your app needs users to grant access to teams they're not a member of, you can create Appwrite Functions with a Server SDK to achieve this functionality.

See https://appwrite.io/docs/advanced/platform/permissions

PingGhost
1 Nov, 2023, 00:59

but that part regarding teams, not label or is it the same? in this case, User A is the owner of the document and he want to share with other user.

Drake
1 Nov, 2023, 01:29

ehhh i guess the docs needs to be updated.

A user can only grant permissions they have.

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