Red
Hello I'm trying to create a document and set a label permission but It doesn't create the document just returns an error, the other permissions seem to work though
Code:
TypeScript
@override
Future<void> uploadContent({
String? customId,
required ContentModel contentModel,
}) async {
const String errorMessage = "Failed to upload content";
final String documentId = customId ?? ID.unique();
Map<dynamic, dynamic> data = contentModel.toJson()
..["academyId"] = uid
..remove("\$id")
..remove("\$createdAt");
try {
await databases.createDocument(
databaseId: Env.databaseId,
collectionId: Env.contentCollectionId,
documentId: documentId,
data: data,
permissions: [
Permission.read(Role.label("content")),
]);
} on AppwriteException catch (e) {
print(e);
throw ContentException("$errorMessage: ${e.message}");
} catch (e) {
throw ContentException("$errorMessage: $e");
}
}
Error:
TypeScript
TL;DR
Developers are trying to create a document and set a label permission, but encounter an 'user_unauthorized' error. The problem is with the specific permission in the permissions list being set. Make sure the permission is one of these: any, users, user:userID, user:userID/verified, users/verified, label:educator. Recommended threads
- Cloud Collections show 404's
I emailed appwrite support several days ago regarding one of my collections returning a 404 in the web interface. I decided to spin up a new project/database ...
- flutter oauth linux & Windows setup
Hey Team, I have failed to find clear instructions of setting up the OAuth for linux and windows. For mobile it is working so far.
- Appwrite.json error
getting a Cannot convert object to primitive value error when running appwrite push collections