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
- Increase by operators
I see appwrite have bunch of useful operators for querieng db. One more I would like to suggest is operators like increase the count of a int columns by 1,2.. ...
- createCollection Deprecated
- All My Project is Gone
Hello everyone, please help. Why have all my projects suddenly disappeared? I received a warning via email about one of my projects being paused. When I clicked...