mirror of
https://github.com/Hackdex-App/hackdex-website.git
synced 2026-03-22 02:04:11 -05:00
Add is_archiver db helper function
This commit is contained in:
parent
a113d8fa98
commit
b3d43e4e50
|
|
@ -349,6 +349,7 @@ export type Database = {
|
|||
get_my_claim: { Args: { claim: string }; Returns: Json }
|
||||
get_my_claims: { Args: never; Returns: Json }
|
||||
is_admin: { Args: never; Returns: boolean }
|
||||
is_archiver: { Args: never; Returns: boolean }
|
||||
is_claims_admin: { Args: never; Returns: boolean }
|
||||
set_claim: {
|
||||
Args: { claim: string; uid: string; value: Json }
|
||||
|
|
|
|||
12
supabase/migrations/20251130013154_add_archiver_role.sql
Normal file
12
supabase/migrations/20251130013154_add_archiver_role.sql
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
CREATE OR REPLACE FUNCTION public.is_archiver()
|
||||
RETURNS boolean
|
||||
LANGUAGE sql
|
||||
STABLE
|
||||
AS $function$
|
||||
select
|
||||
coalesce(get_my_claim('archiver')::bool,false)
|
||||
or
|
||||
coalesce(get_my_claim('claims_admin')::bool,false)
|
||||
$function$
|
||||
;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user