Basically what the title states, cant read the database. It returns the following error
AppwriteException: The current user is not authorized to perform the requested action.
at Client.<anonymous> (file:///C:/Users/meera/GithubDesktop/PitchFork/node_modules/appwrite/dist/esm/sdk.js:391:27)
at Generator.next (<anonymous>)
at fulfilled (file:///C:/Users/meera/GithubDesktop/PitchFork/node_modules/appwrite/dist/esm/sdk.js:22:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 401,
type: 'user_unauthorized',
response: {
message: 'The current user is not authorized to perform the requested action.',
code: 401,
type: 'user_unauthorized',
version: '0.10.19'
}
}
I am really new to appwrite so help is appreciated.
Here is the code:
import { Client, Account, ID, Databases, Permission, Role, Teams } from 'appwrite';
const client = new Client();
const account = new Account(client);
client
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject('646521b8048d4efcd171');
const databases = new Databases(client);
const promise = databases.listDocuments('646522094815b3cf7be4', '64652215e10e469f9e37');
promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
// create the user session
account.createEmailSession('me@example.com','password').then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
Everything seems fine.
Cannot read the Database
why is it giving me the error?
In your Appwrite console add permission to the collection
??
ok
you mean a create a collection called Permission?
You'll need to go to Settings tab inside your collection
Then you can add and set permission for user(s) group
In my example you can see Any have access to Read this collection
yep
got it
it works
tysm @Binyamin
[SOLVED] Cannot read the Database
Recommended threads
- Docker Compose MongoDB Setup
everythings work fine but the mongodb fails on startup everytime. log: ``` Generating random MongoDB keyfile... /bin/bash: line 9: : No such file or directory ...
- Auth broken after update from 1.8.0 to 1...
So ive been having issues creating, deleting or updating users on my appwrite instance after i updated from 1.8.0 to version 1.9.0. When trying to create a user...
- User Blocked - False Positive
Today I tried to log in to my cloud console and it said the user is blocked and I didn't even receive any email regarding this like what kind of violation is my...