Skip to content

Commit

Permalink
Merge pull request #31 from recogito/lwj/base-layer-read-only
Browse files Browse the repository at this point in the history
Fix for missing base layer
  • Loading branch information
lwjameson authored Jul 11, 2024
2 parents 76eebf5 + 3d69bab commit 3fccb59
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SQL Scripts/policies/layer_contexts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CREATE POLICY "Users with correct policies can SELECT on layer_contexts" ON publ
is_archived IS FALSE AND (
public.check_action_policy_organization(auth.uid(), 'layer_contexts', 'SELECT') OR
public.check_action_policy_project_from_context(auth.uid(), 'layer_contexts', 'SELECT', context_id) OR
public.check_action_policy_layer(auth.uid(), 'layer_contexts', 'SELECT', layer_id)
public.check_action_policy_layer_select(auth.uid(), 'layer_contexts', layer_id)
)
);

Expand Down
11 changes: 11 additions & 0 deletions supabase/migrations/20240711184827_fixing_read_only_base_layer.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
drop policy "Users with correct policies can SELECT on layer_contexts" on "public"."layer_contexts";

create policy "Users with correct policies can SELECT on layer_contexts"
on "public"."layer_contexts"
as permissive
for select
to authenticated
using (((is_archived IS FALSE) AND (check_action_policy_organization(auth.uid(), 'layer_contexts'::character varying, 'SELECT'::operation_types) OR check_action_policy_project_from_context(auth.uid(), 'layer_contexts'::character varying, 'SELECT'::operation_types, context_id) OR check_action_policy_layer_select(auth.uid(), 'layer_contexts'::character varying, layer_id))));



0 comments on commit 3fccb59

Please sign in to comment.