Support super manager access
This commit is contained in:
@@ -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: 'Заказы' },
|
||||
|
||||
Reference in New Issue
Block a user