Skip to content
Init is coming / May 19 - 23
Back

[SOLVED] permission

  • 1
  • Users
  • Web
elegante
14 Oct, 2023, 22:57

I'm new to AppWrite and am currently working on a personal Vue project. I'm interested in implementing a permission system that enables users to access the documents they create while restricting other users to only read, update, and delete the documents they themselves have created. How can I accomplish this?

TL;DR
User wants to implement a permission system in a personal Vue project using AppWrite. They want users to only have access to the documents they create and restrict others from accessing them. They have received help and found a solution by following instructions. The solution involves using document level permissions and enabling document security. The user now has CRUD access to their own documents.
Drake
14 Oct, 2023, 23:03

Have you read the permission docs? https://appwrite.io/docs/permissions

elegante
14 Oct, 2023, 23:05

yes I have

Drake
15 Oct, 2023, 01:34

So what are you thinking after reading the docs?

elegante
15 Oct, 2023, 01:38

It's explaination is clear

elegante
15 Oct, 2023, 01:42

I gave access to users to read, create, update and delete documents under a collection, I also enabled document security

elegante
15 Oct, 2023, 01:44

The aspect I find difficult is, I don't want users to access things created by other users. For example, let's say it's a Todo app, with authentication. When a user logs in, he/she sees todo's created by him/herself, not someone else Todo.

elegante
15 Oct, 2023, 01:45

That's what I trying to get 🥲

Drake
15 Oct, 2023, 01:48

If you give users full CRUD access at the collection level, every user can update and delete every document

elegante
15 Oct, 2023, 01:49

Yeah 👌

Drake
15 Oct, 2023, 01:49

So... Don't do that

elegante
15 Oct, 2023, 01:51

Okay, how do I make sure it's just the authorized logged in user that has crud access?

elegante
15 Oct, 2023, 01:55

For example: When a user logs in, he/she should have crud access to messages created by them.

Drake
15 Oct, 2023, 02:03
elegante
15 Oct, 2023, 02:05

Okay thanks, I will look into this and provide feedback.

elegante
15 Oct, 2023, 02:29

I removed permissions from collection level and enabled document security, but I get an unauthorised error

Drake
15 Oct, 2023, 02:58

What operation are you doing? Does the user have access to perform the action?

elegante
15 Oct, 2023, 06:39

It's a create operation

elegante
15 Oct, 2023, 06:41

Since it's showing an unauthorized error I guess not

elegante
15 Oct, 2023, 11:54

Hello Steven, I wanted to express my gratitude for your help and your patience. Finally, I've found the solution I was looking for, by following your instructions.

Drake
15 Oct, 2023, 19:18

[SOLVED] permission

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