Skip to content

Commit

Permalink
feat: only delete restores if allowed at db level (#892)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-silva authored Dec 3, 2024
1 parent 3cde0c7 commit 4071c4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ import { useRBACPermissions } from 'hooks/rbac';
export const RestoreActionButtons = (
row: MRT_Row<Restore>,
handleDeleteRestore: (restoreName: string) => void,
namespace: string
namespace: string,
dbClusterName: string
) => {
const { canDelete } = useRBACPermissions(
'database-cluster-restores',
`${namespace}/${row.original.name}`
`${namespace}/${dbClusterName}`
);

return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ const Restores = () => {
const menuItems = RestoreActionButtons(
row,
handleDeleteBackup,
namespace
namespace,
dbClusterName!
);
return <TableActionsMenu menuItems={menuItems} />;
}}
Expand Down

0 comments on commit 4071c4a

Please sign in to comment.