Skip to content

Commit d0608f4

Browse files
authored
Merge pull request #1166 from rahadi23/bugfix/1165-navigation-items-permissions
fix: filter navigation items based on user's permissions and role
2 parents 537caf0 + adaf12a commit d0608f4

File tree

5 files changed

+449
-332
lines changed

5 files changed

+449
-332
lines changed

apps/dokploy/components/dashboard/projects/handle-project.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const HandleProject = ({ projectId }: Props) => {
118118
</DialogTrigger>
119119
<DialogContent className="sm:m:max-w-lg ">
120120
<DialogHeader>
121-
<DialogTitle>Add a project</DialogTitle>
121+
<DialogTitle>{projectId ? "Update" : "Add a"} project</DialogTitle>
122122
<DialogDescription>The home of something big!</DialogDescription>
123123
</DialogHeader>
124124
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}

apps/dokploy/components/dashboard/projects/show.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,12 @@ export const ShowProjects = () => {
8787
Create and manage your projects
8888
</CardDescription>
8989
</CardHeader>
90-
<div className="">
91-
<HandleProject />
92-
</div>
90+
91+
{(auth?.rol === "admin" || user?.canCreateProjects) && (
92+
<div className="">
93+
<HandleProject />
94+
</div>
95+
)}
9396
</div>
9497

9598
<CardContent className="space-y-2 py-8 border-t gap-4 flex flex-col min-h-[60vh]">

0 commit comments

Comments
 (0)