fix: allow admin edit organization
This commit is contained in:
@@ -983,20 +983,17 @@ with check ((id = ( SELECT organizationmember.organization_id
|
|||||||
LIMIT 1)));
|
LIMIT 1)));
|
||||||
|
|
||||||
|
|
||||||
create policy "User must be an admin to UPDATE"
|
create policy "User must be admin to UPDATE"
|
||||||
on "public"."organization"
|
on "public"."organization"
|
||||||
as permissive
|
as permissive
|
||||||
for update
|
for update
|
||||||
to public
|
to public
|
||||||
using ((id = ( SELECT organizationmember.organization_id
|
using ((id in ( SELECT organizationmember.organization_id
|
||||||
FROM organizationmember
|
FROM organizationmember
|
||||||
WHERE ((organizationmember.profile_id = ( SELECT auth.uid() AS uid)) AND (organizationmember.role_id = 1))
|
WHERE ((organizationmember.profile_id = ( SELECT auth.uid() AS uid)) AND (organizationmember.role_id = 1)))))
|
||||||
LIMIT 1)))
|
with check ((id in ( SELECT organizationmember.organization_id
|
||||||
with check ((id = ( SELECT organizationmember.organization_id
|
|
||||||
FROM organizationmember
|
FROM organizationmember
|
||||||
WHERE ((organizationmember.profile_id = ( SELECT auth.uid() AS uid)) AND (organizationmember.role_id = 1))
|
WHERE ((organizationmember.profile_id = ( SELECT auth.uid() AS uid)) AND (organizationmember.role_id = 1)))));
|
||||||
LIMIT 1)));
|
|
||||||
|
|
||||||
|
|
||||||
create policy "User must be an org member to DELETE"
|
create policy "User must be an org member to DELETE"
|
||||||
on "public"."organization_plan"
|
on "public"."organization_plan"
|
||||||
|
|||||||
Reference in New Issue
Block a user