From 449818ed94e246c5775bcf72ec5d094a31797dbe Mon Sep 17 00:00:00 2001 From: Danel Kungla Date: Fri, 3 Oct 2025 06:58:08 +0300 Subject: [PATCH] add new permission --- app/home/[account]/members/page.tsx | 1 + supabase/migrations/20251002190600_account_management.sql | 2 ++ supabase/migrations/20251002191000_add_new_type.sql | 2 ++ 3 files changed, 5 insertions(+) create mode 100644 supabase/migrations/20251002190600_account_management.sql create mode 100644 supabase/migrations/20251002191000_add_new_type.sql diff --git a/app/home/[account]/members/page.tsx b/app/home/[account]/members/page.tsx index eeb012e..498b7fe 100644 --- a/app/home/[account]/members/page.tsx +++ b/app/home/[account]/members/page.tsx @@ -52,6 +52,7 @@ async function TeamAccountMembersPage({ params }: TeamAccountMembersPageProps) { const canManageRoles = account.permissions.includes('roles.manage'); const canManageInvitations = account.permissions.includes('invites.manage'); + const canManageBenefit = account.permissions.include('benefit.manage'); const isPrimaryOwner = account.primary_owner_user_id === user.id; const currentUserRoleHierarchy = account.role_hierarchy_level; diff --git a/supabase/migrations/20251002190600_account_management.sql b/supabase/migrations/20251002190600_account_management.sql new file mode 100644 index 0000000..f2f5f29 --- /dev/null +++ b/supabase/migrations/20251002190600_account_management.sql @@ -0,0 +1,2 @@ +ALTER TYPE medreport.app_permissions + ADD VALUE IF NOT EXISTS 'benefit.manage'; \ No newline at end of file diff --git a/supabase/migrations/20251002191000_add_new_type.sql b/supabase/migrations/20251002191000_add_new_type.sql new file mode 100644 index 0000000..7467dcd --- /dev/null +++ b/supabase/migrations/20251002191000_add_new_type.sql @@ -0,0 +1,2 @@ +insert into medreport.role_permissions (role, permission) values +('owner', 'benefit.manage'); \ No newline at end of file