Skip to content

Commit

Permalink
Merge pull request #1166 from rahadi23/bugfix/1165-navigation-items-p…
Browse files Browse the repository at this point in the history
…ermissions

fix: filter navigation items based on user's permissions and role
  • Loading branch information
Siumauricio authored Jan 22, 2025
2 parents 537caf0 + adaf12a commit d0608f4
Show file tree
Hide file tree
Showing 5 changed files with 449 additions and 332 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const HandleProject = ({ projectId }: Props) => {
</DialogTrigger>
<DialogContent className="sm:m:max-w-lg ">
<DialogHeader>
<DialogTitle>Add a project</DialogTitle>
<DialogTitle>{projectId ? "Update" : "Add a"} project</DialogTitle>
<DialogDescription>The home of something big!</DialogDescription>
</DialogHeader>
{isError && <AlertBlock type="error">{error?.message}</AlertBlock>}
Expand Down
9 changes: 6 additions & 3 deletions apps/dokploy/components/dashboard/projects/show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ export const ShowProjects = () => {
Create and manage your projects
</CardDescription>
</CardHeader>
<div className="">
<HandleProject />
</div>

{(auth?.rol === "admin" || user?.canCreateProjects) && (
<div className="">
<HandleProject />
</div>
)}
</div>

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

0 comments on commit d0608f4

Please sign in to comment.