Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: Unable to assign roles #167

Closed
2 tasks done
MohamedKamran opened this issue Aug 19, 2023 · 1 comment
Closed
2 tasks done

🐛 Bug Report: Unable to assign roles #167

MohamedKamran opened this issue Aug 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@MohamedKamran
Copy link

MohamedKamran commented Aug 19, 2023

👟 Reproduction steps

Future<Document> addChat(usera, userb) {
    String myname = usera['username'];
    String myid = usera['userid'];
    String opname = userb['username'];
    String opid = userb['userid'];
    String chatid = generateChatID(myid, opid);
    return databases.createDocument(
        databaseId: DATABASE,
        permissions: [
          Permission.read(Role.user("user:$opid")),
          Permission.read(Role.user("user: $opid")),
        ],
        collectionId: MESSAGES,
        documentId: chatid,
        data: {
          'chatid': chatid,
          'users': [
            "{\"name\": \"$myname\", \"userid\": \"$myid\"}",
            "{\"name\": \"$opname\", \"userid\": \"$opid\"}",
          ],
        });
  }

👍 Expected behavior

Creates a New Document with Perms as above

I hv read the issue #106 but thats is for permitting Team as a whole but i need to Permit Single Users

👎 Actual Behavior

but returning Error as

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: AppwriteException: user_unauthorized, Permissions must be one of: (any, users, user:mohamedkamran2211, user:mohamedkamran2211/unverified, users/unverified) (401)

🎲 Appwrite version

Version 2.0.x

💻 Operating system

MacOS

🧱 Your Environment

I use Appwrite Cloud

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

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@MohamedKamran MohamedKamran added the bug Something isn't working label Aug 19, 2023
@MohamedKamran MohamedKamran reopened this Aug 19, 2023
@MohamedKamran
Copy link
Author

It's ok i came to know its for security reasons

@MohamedKamran MohamedKamran closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant