hide create project buttons and modal depending on the permission

This commit is contained in:
Gregor Vostrak
2024-10-28 13:37:39 +01:00
parent eb4debe481
commit cd7573dcf1
11 changed files with 29 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ import type {
import { useClientsStore } from '@/utils/useClients';
import TimePicker from '@/packages/ui/src/Input/TimePicker.vue';
import { getOrganizationCurrencyString } from '@/utils/money';
import { canCreateProjects } from '@/utils/permissions';
const projectStore = useProjectsStore();
const { projects } = storeToRefs(projectStore);
const taskStore = useTasksStore();
@@ -134,6 +135,7 @@ async function createTag(tag: string) {
:clients
:createProject
:createClient
:canCreateProject="canCreateProjects()"
:currency="getOrganizationCurrencyString()"
class="mt-1"
size="xlarge"

View File

@@ -25,6 +25,7 @@ import TimeTrackerRunningInDifferentOrganizationOverlay from '@/packages/ui/src/
import { useClientsStore } from '@/utils/useClients';
import { getOrganizationCurrencyString } from '@/utils/money';
import { isAllowedToPerformPremiumAction } from '@/utils/billing';
import { canCreateProjects } from '@/utils/permissions';
const page = usePage<{
auth: {
@@ -113,6 +114,7 @@ const { tags } = storeToRefs(useTagsStore());
<TimeTrackerControls
:createProject
:enableEstimatedTime="isAllowedToPerformPremiumAction()"
:canCreateProject="canCreateProjects()"
:createClient
:clients
:tags