mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat(services): add role-based delete service permissions
- Restrict bulk delete action to owners and users with delete service permissions - Conditionally render delete button based on user role and authorization - Improve service management security by implementing fine-grained access control
This commit is contained in:
parent
85734c0a24
commit
62bd8e3c95
@ -668,20 +668,24 @@ const Project = (
|
|||||||
Stop
|
Stop
|
||||||
</Button>
|
</Button>
|
||||||
</DialogAction>
|
</DialogAction>
|
||||||
<DialogAction
|
{(auth?.role === "owner" ||
|
||||||
title="Delete Services"
|
auth?.canDeleteServices) && (
|
||||||
description={`Are you sure you want to delete ${selectedServices.length} services? This action cannot be undone.`}
|
<DialogAction
|
||||||
type="destructive"
|
title="Delete Services"
|
||||||
onClick={handleBulkDelete}
|
description={`Are you sure you want to delete ${selectedServices.length} services? This action cannot be undone.`}
|
||||||
>
|
type="destructive"
|
||||||
<Button
|
onClick={handleBulkDelete}
|
||||||
variant="ghost"
|
|
||||||
className="w-full justify-start text-destructive"
|
|
||||||
>
|
>
|
||||||
<Trash2 className="mr-2 h-4 w-4" />
|
<Button
|
||||||
Delete
|
variant="ghost"
|
||||||
</Button>
|
className="w-full justify-start text-destructive"
|
||||||
</DialogAction>
|
>
|
||||||
|
<Trash2 className="mr-2 h-4 w-4" />
|
||||||
|
Delete
|
||||||
|
</Button>
|
||||||
|
</DialogAction>
|
||||||
|
)}
|
||||||
|
|
||||||
<Dialog
|
<Dialog
|
||||||
open={isMoveDialogOpen}
|
open={isMoveDialogOpen}
|
||||||
onOpenChange={setIsMoveDialogOpen}
|
onOpenChange={setIsMoveDialogOpen}
|
||||||
|
Loading…
Reference in New Issue
Block a user