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
- TEAM INVITE
There is a problem with the team invitation. When a user invites other users, that time, the newly created email address they don't get the invite link and old ...
- 500 simultaneous OAuth logins from the s...
Hi, I'd like to ask about rate limiting around Google OAuth login on Appwrite Cloud. **OVERVIEW** Service type: A PWA (web app) for members of a university clu...
- Websites hosted on my appwrite sites hav...
Hello, all my websites hosted on appwrite sites are not running I am getting this message "This site can’t be reached drivehub.appwrite.network took too long t...