pages/admin: add adminRoles

This commit is contained in:
vchikalkin 2024-04-10 10:23:47 +03:00
parent bf06e9e782
commit 65b9043ee3
2 changed files with 3 additions and 2 deletions

View File

@ -1,3 +1,4 @@
export const unlimitedRoles = ['Калькулятор без ограничений'];
export const defaultRoles = ['Лизинговый калькулятор', 'МПЛ', 'Управляющий подразделением'];
export const adminRoles = ['Калькулятор без ограничений', 'Системный администратор'];
export const usersSuper = ['akalinina', 'vchikalkin'];

View File

@ -4,7 +4,7 @@ import initializeApollo from '@/apollo/client';
import { CacheQueries } from '@/Components/Admin';
import { Error } from '@/Components/Common/Error';
import { AdminGrid } from '@/Components/Layout/Page';
import { unlimitedRoles } from '@/config/users';
import { adminRoles } from '@/config/users';
import * as CRMTypes from '@/graphql/crm.types';
import { getPageTitle } from '@/utils/page';
import { dehydrate, QueryClient } from '@tanstack/react-query';
@ -55,7 +55,7 @@ export async function getServerSideProps({ req }) {
},
});
if (!systemuser?.roles?.some((x) => x?.name && unlimitedRoles.includes(x.name))) {
if (!systemuser?.roles?.some((x) => x?.name && adminRoles.includes(x.name))) {
return {
props: {
initialQueryState: dehydrate(queryClient),