claim change claims. Now what I want to do is also let my service role update claims. Currently the function looks like this:
BEGIN IF NOT is_claims_admin() THEN RETURN 'error: access denied'; ELSE update auth.users set raw_app_meta_data = raw_app_meta_data || json_build_object(claim, value)::jsonb where id = uid; return 'OK'; END IF; END;
BEGIN IF NOT is_claims_admin() THEN RETURN 'error: access denied'; ELSE update auth.users set raw_app_meta_data = raw_app_meta_data || json_build_object(claim, value)::jsonb where id = uid; return 'OK'; END IF; END;
I want something like this but I don't know how to achieve it:
BEGIN IF NOT is_claims_admin() OR **SERVICE_ROLE** THEN RETURN 'error: access denied'; ELSE update auth.users set raw_app_meta_data = raw_app_meta_data || json_build_object(claim, value)::jsonb where id = uid; return 'OK'; END IF; END;
BEGIN IF NOT is_claims_admin() OR **SERVICE_ROLE** THEN RETURN 'error: access denied'; ELSE update auth.users set raw_app_meta_data = raw_app_meta_data || json_build_object(claim, value)::jsonb where id = uid; return 'OK'; END IF; END;
Sorry for tagging you @Mark Burggraf but you seem to be the maintainer of that package.
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.