hide shared reports create for employees, fix export request for employees

This commit is contained in:
Gregor Vostrak
2025-05-15 13:07:15 +02:00
committed by Constantin Graf
parent a3dda8b03c
commit b4edcaa2dc
3 changed files with 12 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import { h, ref } from 'vue';
import type { CreateReportBodyProperties } from '@/packages/api/src';
import { isAllowedToPerformPremiumAction } from '@/utils/billing';
import UpgradeModal from '@/Components/Common/UpgradeModal.vue';
import { canCreateReports } from '@/utils/permissions';
defineProps<{
reportProperties: CreateReportBodyProperties;
}>();
@@ -33,7 +34,10 @@ function onSaveReportClick() {
<strong>Sharable Reports</strong> is only available in solidtime
Professional.
</UpgradeModal>
<SecondaryButton :icon="SaveIcon" @click="onSaveReportClick"
<SecondaryButton
v-if="canCreateReports()"
:icon="SaveIcon"
@click="onSaveReportClick"
>Save Report</SecondaryButton
>
</template>

View File

@@ -107,6 +107,10 @@ function getFilterAttributes(): AggregatedTimeEntriesQueryParams {
: undefined,
tag_ids: selectedTags.value.length > 0 ? selectedTags.value : undefined,
billable: billable.value !== null ? billable.value : undefined,
member_id:
getCurrentRole() === 'employee'
? getCurrentMembershipId()
: undefined,
};
return params;
}

View File

@@ -125,4 +125,6 @@ export function canViewAllTimeEntries() {
export function canViewInvoices() {
return currentUserHasPermission('invoices:view');
}
export function canCreateReports() {
return currentUserHasPermission('reports:create');
}