Support super manager access

This commit is contained in:
Ruslan Bakiev
2026-04-04 09:41:36 +07:00
parent ecd92ef7e4
commit ad0bae79e8
8 changed files with 136 additions and 17 deletions

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { useQuery } from '@vue/apollo-composable';
import { MeDocument } from '~/composables/graphql/generated';
import { hasManagerAccess } from '~/utils/roles';
type NavItem = {
to: string;
@@ -17,7 +18,7 @@ const centerCapsule = computed<NavItem[]>(() => {
{ to: '/orders', label: 'Мои заказы' },
];
if (meQuery.result.value?.me?.role === 'MANAGER') {
if (hasManagerAccess(meQuery.result.value?.me?.role)) {
items.push(
{ to: '/clients', label: 'Пользователи' },
{ to: '/client-orders', label: 'Заказы' },