mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
Merge pull request #15469 from supabase/hotfix/empty-state-use-check-permissions
hotfix: EmptyState useCheckPermissions hook rules
This commit is contained in:
1 file changed
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { FC } from 'react'
|
||||
import { observer } from 'mobx-react-lite'
|
||||
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
||||
import { checkPermissions, useLocalStorage, useStore } from 'hooks'
|
||||
import { useCheckPermissions, useLocalStorage, useStore } from 'hooks'
|
||||
import { useEntityTypesQuery } from 'data/entity-types/entity-types-infinite-query'
|
||||
import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState'
|
||||
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
|
||||
@@ -15,7 +15,7 @@ const EmptyState: FC<Props> = ({ selectedSchema, onAddTable }) => {
|
||||
const { meta } = useStore()
|
||||
const isProtectedSchema = meta.excludedSchemas.includes(selectedSchema)
|
||||
const canCreateTables =
|
||||
!isProtectedSchema && checkPermissions(PermissionAction.TENANT_SQL_ADMIN_WRITE, 'tables')
|
||||
useCheckPermissions(PermissionAction.TENANT_SQL_ADMIN_WRITE, 'tables') && !isProtectedSchema
|
||||
|
||||
const [sort] = useLocalStorage<'alphabetical' | 'grouped-alphabetical'>(
|
||||
'table-editor-sort',
|
||||
|
||||
Reference in new issue
Block a user