Skip to content

401: Permission error on document creation #983

Closed

Description

@iSplasher

🐛 Bug Report

Hello, I'm getting a 401 error no matter what combinations of permissions and accounts i test with.
I have read access but not write access.
One thing to note is that the account is unverified. But I'm pretty sure this shouldn't be an issue.

Have you spent some time to check if this issue has been raised before?

The only other issue I could find was #801, but that seemed resolved already?

To Reproduce

I set permissions on my collection

billede

Notice that I've even tried with the user id and put the user into a team to no avail.
In my client, I create

billede

The account is created like it should. I can find it in Console under Users also.
I login successfully. I retrieve the session

billede
billede

I can even get the session again

billede

But as soon as I try to create a document I get

billede

billede

Expected behavior

That account should have write access as specified.

Your Environment

I'm using NextJS.

billede

Activity

  1. added
    bug
    on Mar 15, 2021
  2. christyjacob4 commented on Mar 15, 2021

    @christyjacob4
    Contributor

    @iSplasher in your createDocument() function can you also add wildcard permission to the write permissions like this write : ['*']

  3. iSplasher commented on Mar 15, 2021

    @iSplasher
    Author

    Oh wow, that worked.
    billede

    I must admit that these permissions are a bit confusing.
    Wouldn't it make sense to give the owner of the document write permission automatically? Or at least make the parameters optional where the default is to give the current user access to that document. Know that I copied most of these snippets of code from your docs.
    Either way, thank you for the help.

  4. christyjacob4 commented on Mar 17, 2021

    @christyjacob4
    Contributor

    Thanks for the feedback @iSplasher . We are in the process of a DB refactoring and during that we will address this issue :)
    You can follow the discussion here appwrite/rfc#21

  5. christyjacob4 commented on Mar 17, 2021

    @christyjacob4
    Contributor

    Please close this issue if you don't have any more doubts 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions