diff --git a/apps/dokploy/components/dashboard/settings/users/show-users.tsx b/apps/dokploy/components/dashboard/settings/users/show-users.tsx index 6d240ae50..ca03045c6 100644 --- a/apps/dokploy/components/dashboard/settings/users/show-users.tsx +++ b/apps/dokploy/components/dashboard/settings/users/show-users.tsx @@ -1,6 +1,7 @@ import { format } from "date-fns"; import { Loader2, MoreHorizontal, Users } from "lucide-react"; import { toast } from "sonner"; +import { AlertBlock } from "@/components/shared/alert-block"; import { DialogAction } from "@/components/shared/dialog-action"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; @@ -36,10 +37,19 @@ export const ShowUsers = () => { const { data, isPending, refetch } = api.user.all.useQuery(); const { mutateAsync } = api.user.remove.useMutation(); const { data: permissions } = api.user.getPermissions.useQuery(); + const { data: hasValidLicense } = + api.licenseKey.haveValidLicenseKey.useQuery(); const utils = api.useUtils(); const { data: session } = api.user.session.useQuery(); + const FREE_ROLES = ["owner", "admin", "member"]; + const membersWithCustomRoles = data?.filter( + (member) => !FREE_ROLES.includes(member.role), + ); + const hasCustomRolesWithoutLicense = + !hasValidLicense && (membersWithCustomRoles?.length ?? 0) > 0; + return (