Back
AppwriteException: Permissions must be one of: (any, users,.. while adding permission to document
- 0
- Auth
i get the below error when i try to add permission to my document after enabling document security
- Error ->
= AppwriteException: user_unauthorized, Permissions must be one of: (any, users, user:66bdbf3b00307d0c573d, user:66bdbf3b00307d0c573d/unverified, users/unverified, team:66be1683e7ee5f4f3c76, member:66be1683ed78c5e0bec9, team:66be1683e7ee5f4f3c76/owner, team:66be171c10782cac3d3a, member:66be171c22e96a0caacb, team:66be171c10782cac3d3a/owner, team:66be2072236d76f129c7, member:66be20722887036722a2, team:66be2072236d76f129c7/owner, team:66be6062c650b8cccd5a, member:66be6062e70c194417a4, team:66be6062c650b8cccd5a/owner, team:66be609e088fa6bc8766, member:66be609e27179ee817e3, team:66be609e088fa6bc8766/owner, team:66be61b9d943d2db2cbe, member:66be61ba06892022f8e2, team:66be61b9d943d2db2cbe/owner, team:66be62cbbb5c392b346f, member:66be62cbdb02a5eba9d7, team:66be62cbbb5c392b346f/owner, team:66be62e9e75a0ac58ba9, member:66be62ea14a9db2ab151, team:66be62e9e75a0ac58ba9/owner) (401)
and below is my dart code
TypeScript
try {
final res = await db.createDocument(
databaseId: AppWriteConstants.dbId,
collectionId: AppWriteConstants.venueId,
documentId: ID.unique(),
data: venueModel.toMap(),
permissions: [
Permission.read(Role.team(teamId)),
Permission.write(Role.team(teamId, 'admin')),
Permission.update(Role.team(teamId, 'coordinators')),
Permission.update(Role.team(teamId, 'security')),
Permission.delete(Role.team(teamId, 'security')),
//---extras
Permission.update(Role.team(teamId, 'update')),
Permission.delete(Role.team(teamId, 'delete')),
],
);
return Venue.fromMap(res.data);
} on AppwriteException catch (e) {
TL;DR
Error message suggests that the permissions specified in the code are incorrect. The permissions should be one of the listed options. Check the permissions assigned in the Dart code and ensure they match the required format.
Solution: Update the permissions in the Dart code to match the correct format specified in the error message.Recommended threads
- Compatibility issue with Kakao OpenID Co...
**Context:** I am attempting to integrate **Kakao Login** (one of the largest social login providers in South Korea) into my Flutter application using Appwrite'...
- Student plan issue
I am using GitHub student plan, I even got access to appwrite's mock phone number. but when I try to use it, it says the phone number limit has reached
- Getting "The current user has been block...
So today I want to deploy something to Appwrite but when I click Sign in with Github, it's redirect me to login site and in the url bar I see this `?error=%7B"m...