supabase postgress roles error in flutter

28 views Asked by At

in supabase

after creating role 'adminRole'

then granting the role to an email through

update auth.users set role = 'adminRole' where email='my email';

i checked the table and it did update.

then created a table and activated row level security with a policy to select, update and delete for adminRole

now when i try to run a select query from my flutter app it throws an exception

"

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PostgrestException(message: permission denied to set role "adminRole", code: 42501, details: Forbidden, hint: null)"

i tried doing a grant adminrole but after searching i cant really check if my sql query is right
i tried

GRANT adminRole TO 'myemail';


grant adminRole to auth.users
where
  email = 'myemail';
0

There are 0 answers