Skip to content

Instantly share code, notes, and snippets.

@ronaldaug
Created April 18, 2025 07:20
Show Gist options
  • Select an option

  • Save ronaldaug/a08509518241626c03cd2233c6d3332c to your computer and use it in GitHub Desktop.

Select an option

Save ronaldaug/a08509518241626c03cd2233c6d3332c to your computer and use it in GitHub Desktop.

Revisions

  1. ronaldaug created this gist Apr 18, 2025.
    23 changes: 23 additions & 0 deletions fourpolicies.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    -- Read
    create policy "Allow authorized read access"
    on leaves for select
    to authenticated
    using (authorize('leaves.read'));

    -- Create
    create policy "Allow authorized create access"
    on leaves for insert
    to authenticated
    with check (authorize('leaves.create'));

    -- Update
    create policy "Allow authorized update access"
    on leaves for update
    to authenticated
    using (authorize('leaves.update'));

    -- Delete
    create policy "Allow authorized delete access"
    on leaves for delete
    to authenticated
    using (authorize('leaves.delete'));