Skip to content
Back

Dynamic Roles

  • 0
  • Web
  • Cloud
astro
4 Nov, 2025, 01:09

I tried to store a row with this permissions: permissions.push( Permission.read(Role.users("verified")), Permission.write(Role.label(c-${calendarSlug}.admin)), Permission.update(Role.label(c-${calendarSlug}.editor)), Permission.write(Role.user(user.$id)),

but i get this error:

'{"message":"Permissions must be one of: (roles and labels of my project) ","code":401,"type":"user_unauthorized","version":"1.8.0"}'

so i mean i cant set row level permissions before i created them, i think i trying to set dinamyc permissions but idk if that works

TL;DR
Developers are experiencing limitations with creating permissions for unassigned roles in TablesDB. The solution is to use an API key if the user needs to assign permissions they do not have.
astro
4 Nov, 2025, 01:10

there is another way that can work something like this?

fiorex
19 Mar, 2026, 17:42

hello, i have the same exact problem, it seems that TablesDB does not consent to create a Permission for a role that has not yet been assigned to at least one user. this is a big limitation guys and it seems there isn't any workaround

Steven
19 Mar, 2026, 23:39

A user cannot assign a permission they do not have. If you need to do that, use an API key.

See docs.

fiorex
20 Mar, 2026, 09:00

Hey @Steven thanks for the reponse, however this is not the same problem i think, i have an user that is "owner" of the team so i expect that he could do "whatever" he wants with the team, like create a new row and assign other team members with different role different permissions. the docs you linked say "A project user can only grant permissions to a resource that they have" and "If your app needs users to grant access to teams they're not a member of" but my user is owner of the Team, simpl,t "editor" and "user" roles hasn't any team member assigned yet. i hope i explain well and thanks again

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more