pages/admin: add adminRoles
This commit is contained in:
parent
bf06e9e782
commit
65b9043ee3
@ -1,3 +1,4 @@
|
||||
export const unlimitedRoles = ['Калькулятор без ограничений'];
|
||||
export const defaultRoles = ['Лизинговый калькулятор', 'МПЛ', 'Управляющий подразделением'];
|
||||
export const adminRoles = ['Калькулятор без ограничений', 'Системный администратор'];
|
||||
export const usersSuper = ['akalinina', 'vchikalkin'];
|
||||
|
||||
@ -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),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user