Back

[SOLVED] Document Authorization

  • 1
  • Databases
  • Web
Kenny
17 Aug, 2023, 01:30

Worked just fine

TL;DR
The issue of document authorization has been solved. The user had overlooked an easy solution. One of the updates being worked on is allowing the updating of a document as long as the related document is not being updated. The user had the correct permissions, but there was an issue with the relationships. The solution was to remove and then add back the permissions. Additionally, there were some suggestions to check the database and bulk edit the permissions of the collection.
Binyamin
17 Aug, 2023, 01:30

Maybe the old document didn't got the new permissions some how

Kenny
17 Aug, 2023, 01:31

Any ideas on what I can do?

Binyamin
17 Aug, 2023, 01:31

For the old one? Is this a self-hosted?

Kenny
17 Aug, 2023, 01:31

Yes self hosted, 1.3.8, DigitalOcean

Binyamin
17 Aug, 2023, 01:35

You can try connecting to your MariaDB using this gist https://gist.github.com/byawitz/885510a4d9789e97424337e9472276d7 Then you can bulk edit the permission of the collection inside the meta and collection tables

Kenny
17 Aug, 2023, 01:36

I'll see what I can do :) Thanks

Kenny
17 Aug, 2023, 01:54

Looking in the database all the permissions seem to be correct. I've not changed anything yet.

Kenny
17 Aug, 2023, 01:55

That one empty array should be empty

Kenny
17 Aug, 2023, 01:57

I removed the permissions and then added them back and am getting this.

Kenny
17 Aug, 2023, 02:09

I can fetch the document I'm looking to update and see it has the correct permissions. I've put both my get and updates here, maybe I'm just blind and not seeing something?

Drake
17 Aug, 2023, 02:28

Did you upgrade to 1.3.8?

Drake
17 Aug, 2023, 02:30

Do you have relationships on the collection?

Kenny
17 Aug, 2023, 02:32

Yes and yes

Kenny
17 Aug, 2023, 02:33

I guess the new record that was created has no actual relationships made, is the issue authorization on the relationship?

Drake
17 Aug, 2023, 02:33

Possibly. Does the user have update access to the related document?

Kenny
17 Aug, 2023, 02:34

no only read

Drake
17 Aug, 2023, 02:34

That's probably it then

Kenny
17 Aug, 2023, 02:35

:( I knew it would be something easy I just overlooked.

Kenny
17 Aug, 2023, 02:36

Yep, that fixed it. Thank you very much!

Kenny
17 Aug, 2023, 02:36

[SOLVED] Document Authorization

Drake
17 Aug, 2023, 02:37

We're working on a ton of updates to relationships. One of which is allowing updating a document that has a relationship as long as you're not updating the related document

Kenny
17 Aug, 2023, 02:37

Sounds awesome! :) Excited for the upcoming updates.

Binyamin
17 Aug, 2023, 02:37

Was out Already got solved by Steven as usual 😉

Kenny
17 Aug, 2023, 02:38

Thanks for all your help though! I appreciate the assistance :)

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