refactor: simplify user permission checks across application

This commit is contained in:
Mauricio Siu
2025-02-21 00:40:35 -06:00
parent 24c9d3f7ad
commit a317f0c4cc
19 changed files with 52 additions and 34 deletions

View File

@@ -83,7 +83,7 @@ export const ShowProjects = () => {
</CardDescription>
</CardHeader>
{(auth?.role === "owner" || auth?.user?.canCreateProjects) && (
{(auth?.role === "owner" || auth?.canCreateProjects) && (
<div className="">
<HandleProject />
</div>
@@ -286,7 +286,7 @@ export const ShowProjects = () => {
onClick={(e) => e.stopPropagation()}
>
{(auth?.role === "owner" ||
auth?.user?.canDeleteProjects) && (
auth?.canDeleteProjects) && (
<AlertDialog>
<AlertDialogTrigger className="w-full">
<DropdownMenuItem