I try to create a row in my table but when i submit i have an error on my permission, i'm new on it so i dont understand the error. I have Row Security enable
export const createGoal = async ( { exercise, progress, total, }: CreateGoalParams ) => { const currentUser = await getCurrentUser(); if ( !currentUser ) { throw new Error( "Utilisateur non connecté" ); }
// Vérifier limite objectifs actifs const existingGoals = await getGoalsFromUser(); const activeGoals = existingGoals.filter( ( g ) => g.state === "in-progress" );
if ( activeGoals.length >= LIMITS.MAX_GOALS ) {
return {
message: {
title: "Limite atteinte",
body: Maximum ${LIMITS.MAX_GOALS} objectifs en cours.,
},
};
}
const newRow = await tablesDB.createRow( { databaseId, tableId: goalTable, rowId: ID.unique(), data: { exercise, progress, targetValue: total, progressHistory: [ progress ], state: "in-progress", }, permissions: [ Permission.read( Role.user( currentUser.$id ) ), Permission.update( Role.user( currentUser.$id ) ), Permission.delete( Role.user( currentUser.$id ) ), ], } );
const goal = await buildGoalObject( newRow );
return { goal, message: { title: "Objectif créé", body: "Votre objectif a été créé avec succès.", }, }; };
Did i just have to add all user permissions on the table ?
LOG [AppwriteException: Permissions must be one of: (any, users, user:68f7a373002bb5e49748, user:68f7a373002bb5e49748/verified, users/verified)]
Recommended threads
- Console: Query on attribute has greater ...
I noticed an issue when one of my tables reached over ~800 rows. That table is relational to my users table Within the console I am able to view the table with ...
- Appwrite 1.8.1 TablesDB Permissions Issu...
Hi - I'm migrating a newer VueJS web application from Supabase to Appwrite. I'm looking for an experienced Appwrite Developer to help me solve a permissions iss...
- Relations within the same table
Hello, I'm currently building a sort of dictionary (a literal one) and thus I need words (which is one single table of words in my database) to be able to have ...