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
- Relation Question
How do I create a relation from table y to an others x.$id. in my example I have a users table where I use Appwrites unique User IDs and I want other tables fo...
- Unknown attribute type: varchar / text
Since the `string` type is deprecated I tried using `varchar` and `text` in some newer tables, but when running `appwrite pull tables && appwrite types ./src/li...
- Query.search limitation
Since `string` is deprecated I used `varchar`, and now I cant use `Query.contains` , so I setup fulltext index and started using `Query.search` the issue is `Qu...