-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sponsor access to tables (fix sponsor portal check in listener) (#…
…515) * Add sponsor access to tables * Oops * Fix invalid sql syntax
- Loading branch information
1 parent
7745060
commit 79df1f8
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
supabase/migrations/20231101000000_add_sponsor_access_events.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
create or replace function get_sponsors() | ||
returns setof uuid | ||
language sql | ||
security definer | ||
set search_path = public | ||
stable | ||
as $$ | ||
select user_id | ||
from user_profiles | ||
where user_profiles.role = 3 | ||
$$; | ||
|
||
create policy "Allow sponsors to access all rows" | ||
on public.user_profiles | ||
for select | ||
to authenticated | ||
using (auth.uid() in ( | ||
select get_sponsors() | ||
)); | ||
|
||
create policy "Allow sponsors to access all rows" | ||
on public.event_log | ||
for select | ||
to authenticated | ||
using (auth.uid() in ( | ||
select get_sponsors() | ||
)); | ||
|
||
create policy "Allow sponsors to access all rows" | ||
on public.events | ||
for select | ||
to authenticated | ||
using (auth.uid() in ( | ||
select get_sponsors() | ||
)); | ||
|
||
create policy "Allow sponsors to access all rows" | ||
on public.participants | ||
for select | ||
to authenticated | ||
using (auth.uid() in ( | ||
select get_sponsors() | ||
)); |
79df1f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
pointr – ./
pointr.vercel.app
www.hack.sc
pointr-git-main-hacksc.vercel.app
pointr-hacksc.vercel.app
79df1f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
recruitment – ./
recruitment-hacksc.vercel.app
recruitment-git-main-hacksc.vercel.app
79df1f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
www-2023 – ./
www-2023-hacksc.vercel.app
www-2023-git-main-hacksc.vercel.app
www-2023.vercel.app
2023.hacksc.com
79df1f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
interim – ./
interim-git-main-hacksc.vercel.app
interim-hacksc.vercel.app
www.socalhacks.org
socalhacks.org
79df1f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
ui-kit-2023-storybook – ./
ui-kit-2023-storybook-git-main-hacksc.vercel.app
storybook.hacksc.com
ui-kit-2023-storybook-hacksc.vercel.app
ui-kit-2023-storybook.vercel.app
79df1f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
dashboard – ./
dashboard-sable-sigma.vercel.app
dashboard-hacksc.vercel.app
dashboard.hacksc.com
dashboard-git-main-hacksc.vercel.app
79df1f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
sso – ./
sso-hacksc.vercel.app
sso.hacksc.com
sso-steel.vercel.app
sso-git-main-hacksc.vercel.app