Back

[SOLVED] Updating Document Permissions

  • 1
  • Self Hosted
  • Functions
  • Databases
enoy
19 Feb, 2023, 10:11

according to my docker compose: 1.2.0

I am not doing anything fancy:

TypeScript
await database.updateDocument(dbId, collIds['public-tasks'], currentAvailablePublicTask.$id, {
        ...someData
      }, [
        Permission.read(Role.team(teamIds.worker))
      ]);
TL;DR
The user had a problem with updating document permissions. They initially thought it was a code issue, but it turned out to be their mistake. The problem was resolved. No solution was provided in the support thread.
Drake
19 Feb, 2023, 15:44

And what error are you getting?

Drake
19 Feb, 2023, 15:45

What version of the SDK are you using?

enoy
20 Feb, 2023, 14:06

according to my package lock: node-appwrite-8.2.0 I get no error

Drake
20 Feb, 2023, 14:46

Everything seems fine...you're saying the permission doesn't get updated?

enoy
20 Feb, 2023, 14:57

This seems odd. I'll try again later. Maybe I am just missing something (I guess I didn't await correctly)

VincentGe
20 Feb, 2023, 15:41

Your collection has document level permissions enabled right?

enoy
20 Feb, 2023, 15:42

Yes

VincentGe
20 Feb, 2023, 15:43

🤔🤔🤔

VincentGe
20 Feb, 2023, 15:45

if you try updating the data, does the data update successfully?

VincentGe
20 Feb, 2023, 15:45

Can you also check the permissions of your API key?

enoy
20 Feb, 2023, 15:47

yes the data updates perfectly

enoy
20 Feb, 2023, 15:48

I gave my api key full permission. activated all scopes.

VincentGe
20 Feb, 2023, 15:48

hmmmmmmm that's really strange 😅 I can't repro this on 1.0 or 1.2

VincentGe
20 Feb, 2023, 15:49

Do you mind trying a different permission?

VincentGe
20 Feb, 2023, 15:49

like a brute force read.any

VincentGe
20 Feb, 2023, 15:50

I wonder if team permissions are broken

enoy
20 Feb, 2023, 16:55

Thanks for not trusting me... I f*ed up. It works like you guys were telling and the error was on my part.

enoy
20 Feb, 2023, 16:55

Thanks @VincentGe and @Steven for you time 🙂

Drake
20 Feb, 2023, 17:18

what was the problem?

VincentGe
20 Feb, 2023, 18:20

I'm glad it worked out 😛 Happy to brain storm ideas with you <:appwritepeepo:902865250427215882>

enoy
27 Feb, 2023, 19:17

sorry for the late answer. I myself was the problem. I deployed the wrong code somehow and didn't notice

enoy
27 Feb, 2023, 19:17

thank you ❤️

VincentGe
27 Feb, 2023, 19:30

[SOLVED] Updating Document Permissions

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