mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-28 02:46:09 +00:00
UI : Permission fix for create operation (#7324)
This commit is contained in:
parent
27f94e45ab
commit
72b15d71ba
@ -19,7 +19,6 @@ import cronstrue from 'cronstrue';
|
|||||||
import { capitalize, isNil, lowerCase, startCase } from 'lodash';
|
import { capitalize, isNil, lowerCase, startCase } from 'lodash';
|
||||||
import React, { Fragment, useCallback, useState } from 'react';
|
import React, { Fragment, useCallback, useState } from 'react';
|
||||||
import { Link, useHistory } from 'react-router-dom';
|
import { Link, useHistory } from 'react-router-dom';
|
||||||
import { useAuthContext } from '../../authentication/auth-provider/AuthProvider';
|
|
||||||
import { PAGE_SIZE } from '../../constants/constants';
|
import { PAGE_SIZE } from '../../constants/constants';
|
||||||
import { NO_PERMISSION_TO_VIEW } from '../../constants/HelperTextUtil';
|
import { NO_PERMISSION_TO_VIEW } from '../../constants/HelperTextUtil';
|
||||||
import { Connection } from '../../generated/entity/services/databaseService';
|
import { Connection } from '../../generated/entity/services/databaseService';
|
||||||
@ -27,7 +26,6 @@ import {
|
|||||||
IngestionPipeline,
|
IngestionPipeline,
|
||||||
PipelineType,
|
PipelineType,
|
||||||
} from '../../generated/entity/services/ingestionPipelines/ingestionPipeline';
|
} from '../../generated/entity/services/ingestionPipelines/ingestionPipeline';
|
||||||
import { useAuth } from '../../hooks/authHooks';
|
|
||||||
import { isEven } from '../../utils/CommonUtils';
|
import { isEven } from '../../utils/CommonUtils';
|
||||||
import {
|
import {
|
||||||
getAddIngestionPath,
|
getAddIngestionPath,
|
||||||
@ -64,8 +62,7 @@ const Ingestion: React.FC<IngestionProps> = ({
|
|||||||
permissions,
|
permissions,
|
||||||
}: IngestionProps) => {
|
}: IngestionProps) => {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const { isAdminUser } = useAuth();
|
|
||||||
const { isAuthDisabled } = useAuthContext();
|
|
||||||
const [searchText, setSearchText] = useState('');
|
const [searchText, setSearchText] = useState('');
|
||||||
const [showActions, setShowActions] = useState(false);
|
const [showActions, setShowActions] = useState(false);
|
||||||
const [currTriggerId, setCurrTriggerId] = useState({ id: '', state: '' });
|
const [currTriggerId, setCurrTriggerId] = useState({ id: '', state: '' });
|
||||||
@ -419,7 +416,7 @@ const Ingestion: React.FC<IngestionProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
<div className="tw-relative">
|
<div className="tw-relative">
|
||||||
{isRequiredDetailsAvailable &&
|
{isRequiredDetailsAvailable &&
|
||||||
(isAdminUser || isAuthDisabled) &&
|
permissions.EditAll &&
|
||||||
getAddIngestionElement()}
|
getAddIngestionElement()}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,23 +1,24 @@
|
|||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import { LoadingState } from 'Models';
|
import { LoadingState } from 'Models';
|
||||||
import React, { FunctionComponent, useEffect, useState } from 'react';
|
import React, { FunctionComponent, useEffect, useMemo, useState } from 'react';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { useAuthContext } from '../../authentication/auth-provider/AuthProvider';
|
|
||||||
import { addGlossaries } from '../../axiosAPIs/glossaryAPI';
|
import { addGlossaries } from '../../axiosAPIs/glossaryAPI';
|
||||||
import AddGlossary from '../../components/AddGlossary/AddGlossary.component';
|
import AddGlossary from '../../components/AddGlossary/AddGlossary.component';
|
||||||
import { TitleBreadcrumbProps } from '../../components/common/title-breadcrumb/title-breadcrumb.interface';
|
import { TitleBreadcrumbProps } from '../../components/common/title-breadcrumb/title-breadcrumb.interface';
|
||||||
import PageContainerV1 from '../../components/containers/PageContainerV1';
|
import PageContainerV1 from '../../components/containers/PageContainerV1';
|
||||||
|
import { usePermissionProvider } from '../../components/PermissionProvider/PermissionProvider';
|
||||||
|
import { ResourceEntity } from '../../components/PermissionProvider/PermissionProvider.interface';
|
||||||
import { CreateGlossary } from '../../generated/api/data/createGlossary';
|
import { CreateGlossary } from '../../generated/api/data/createGlossary';
|
||||||
import { useAuth } from '../../hooks/authHooks';
|
import { Operation } from '../../generated/entity/policies/policy';
|
||||||
import jsonData from '../../jsons/en';
|
import jsonData from '../../jsons/en';
|
||||||
|
import { checkPermission } from '../../utils/PermissionsUtils';
|
||||||
import { getGlossaryPath } from '../../utils/RouterUtils';
|
import { getGlossaryPath } from '../../utils/RouterUtils';
|
||||||
import { getTagCategories, getTaglist } from '../../utils/TagsUtils';
|
import { getTagCategories, getTaglist } from '../../utils/TagsUtils';
|
||||||
import { showErrorToast } from '../../utils/ToastUtils';
|
import { showErrorToast } from '../../utils/ToastUtils';
|
||||||
|
|
||||||
const AddGlossaryPage: FunctionComponent = () => {
|
const AddGlossaryPage: FunctionComponent = () => {
|
||||||
const { isAdminUser } = useAuth();
|
|
||||||
const { isAuthDisabled } = useAuthContext();
|
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
const { permissions } = usePermissionProvider();
|
||||||
const [tagList, setTagList] = useState<Array<string>>([]);
|
const [tagList, setTagList] = useState<Array<string>>([]);
|
||||||
const [isTagLoading, setIsTagLoading] = useState<boolean>(false);
|
const [isTagLoading, setIsTagLoading] = useState<boolean>(false);
|
||||||
const [status, setStatus] = useState<LoadingState>('initial');
|
const [status, setStatus] = useState<LoadingState>('initial');
|
||||||
@ -25,6 +26,12 @@ const AddGlossaryPage: FunctionComponent = () => {
|
|||||||
TitleBreadcrumbProps['titleLinks']
|
TitleBreadcrumbProps['titleLinks']
|
||||||
>([]);
|
>([]);
|
||||||
|
|
||||||
|
const createPermission = useMemo(
|
||||||
|
() =>
|
||||||
|
checkPermission(Operation.Create, ResourceEntity.GLOSSARY, permissions),
|
||||||
|
[permissions]
|
||||||
|
);
|
||||||
|
|
||||||
const goToGlossary = (name = '') => {
|
const goToGlossary = (name = '') => {
|
||||||
history.push(getGlossaryPath(name));
|
history.push(getGlossaryPath(name));
|
||||||
};
|
};
|
||||||
@ -101,7 +108,7 @@ const AddGlossaryPage: FunctionComponent = () => {
|
|||||||
<PageContainerV1>
|
<PageContainerV1>
|
||||||
<div className="tw-self-center">
|
<div className="tw-self-center">
|
||||||
<AddGlossary
|
<AddGlossary
|
||||||
allowAccess={isAdminUser || isAuthDisabled}
|
allowAccess={createPermission}
|
||||||
fetchTags={fetchTags}
|
fetchTags={fetchTags}
|
||||||
header="Add Glossary"
|
header="Add Glossary"
|
||||||
isTagLoading={isTagLoading}
|
isTagLoading={isTagLoading}
|
||||||
|
@ -14,9 +14,8 @@
|
|||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import { cloneDeep, get, isUndefined } from 'lodash';
|
import { cloneDeep, get, isUndefined } from 'lodash';
|
||||||
import { LoadingState } from 'Models';
|
import { LoadingState } from 'Models';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useMemo, useState } from 'react';
|
||||||
import { useHistory, useParams } from 'react-router-dom';
|
import { useHistory, useParams } from 'react-router-dom';
|
||||||
import { useAuthContext } from '../../authentication/auth-provider/AuthProvider';
|
|
||||||
import {
|
import {
|
||||||
addGlossaryTerm,
|
addGlossaryTerm,
|
||||||
getGlossariesByName,
|
getGlossariesByName,
|
||||||
@ -26,11 +25,14 @@ import AddGlossaryTerm from '../../components/AddGlossaryTerm/AddGlossaryTerm.co
|
|||||||
import { TitleBreadcrumbProps } from '../../components/common/title-breadcrumb/title-breadcrumb.interface';
|
import { TitleBreadcrumbProps } from '../../components/common/title-breadcrumb/title-breadcrumb.interface';
|
||||||
import PageContainerV1 from '../../components/containers/PageContainerV1';
|
import PageContainerV1 from '../../components/containers/PageContainerV1';
|
||||||
import Loader from '../../components/Loader/Loader';
|
import Loader from '../../components/Loader/Loader';
|
||||||
|
import { usePermissionProvider } from '../../components/PermissionProvider/PermissionProvider';
|
||||||
|
import { ResourceEntity } from '../../components/PermissionProvider/PermissionProvider.interface';
|
||||||
import { CreateGlossaryTerm } from '../../generated/api/data/createGlossaryTerm';
|
import { CreateGlossaryTerm } from '../../generated/api/data/createGlossaryTerm';
|
||||||
import { Glossary } from '../../generated/entity/data/glossary';
|
import { Glossary } from '../../generated/entity/data/glossary';
|
||||||
import { GlossaryTerm } from '../../generated/entity/data/glossaryTerm';
|
import { GlossaryTerm } from '../../generated/entity/data/glossaryTerm';
|
||||||
import { useAuth } from '../../hooks/authHooks';
|
import { Operation } from '../../generated/entity/policies/policy';
|
||||||
import jsonData from '../../jsons/en';
|
import jsonData from '../../jsons/en';
|
||||||
|
import { checkPermission } from '../../utils/PermissionsUtils';
|
||||||
import { getGlossaryPath } from '../../utils/RouterUtils';
|
import { getGlossaryPath } from '../../utils/RouterUtils';
|
||||||
import { showErrorToast } from '../../utils/ToastUtils';
|
import { showErrorToast } from '../../utils/ToastUtils';
|
||||||
|
|
||||||
@ -38,8 +40,7 @@ const AddGlossaryTermPage = () => {
|
|||||||
const { glossaryName, glossaryTermsFQN } =
|
const { glossaryName, glossaryTermsFQN } =
|
||||||
useParams<{ [key: string]: string }>();
|
useParams<{ [key: string]: string }>();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const { isAdminUser } = useAuth();
|
const { permissions } = usePermissionProvider();
|
||||||
const { isAuthDisabled } = useAuthContext();
|
|
||||||
const [status, setStatus] = useState<LoadingState>('initial');
|
const [status, setStatus] = useState<LoadingState>('initial');
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [glossaryData, setGlossaryData] = useState<Glossary>();
|
const [glossaryData, setGlossaryData] = useState<Glossary>();
|
||||||
@ -49,6 +50,16 @@ const AddGlossaryTermPage = () => {
|
|||||||
|
|
||||||
const [parentGlossaryData, setParentGlossaryData] = useState<GlossaryTerm>();
|
const [parentGlossaryData, setParentGlossaryData] = useState<GlossaryTerm>();
|
||||||
|
|
||||||
|
const createPermission = useMemo(
|
||||||
|
() =>
|
||||||
|
checkPermission(
|
||||||
|
Operation.Create,
|
||||||
|
ResourceEntity.GLOSSARY_TERM,
|
||||||
|
permissions
|
||||||
|
),
|
||||||
|
[permissions]
|
||||||
|
);
|
||||||
|
|
||||||
const goToGlossaryPath = (path: string) => {
|
const goToGlossaryPath = (path: string) => {
|
||||||
history.push(path);
|
history.push(path);
|
||||||
};
|
};
|
||||||
@ -198,7 +209,7 @@ const AddGlossaryTermPage = () => {
|
|||||||
) : (
|
) : (
|
||||||
<div className="tw-self-center">
|
<div className="tw-self-center">
|
||||||
<AddGlossaryTerm
|
<AddGlossaryTerm
|
||||||
allowAccess={isAdminUser || isAuthDisabled}
|
allowAccess={createPermission}
|
||||||
glossaryData={glossaryData as Glossary}
|
glossaryData={glossaryData as Glossary}
|
||||||
parentGlossaryData={parentGlossaryData}
|
parentGlossaryData={parentGlossaryData}
|
||||||
saveState={status}
|
saveState={status}
|
||||||
|
@ -13,12 +13,13 @@
|
|||||||
|
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import { LoadingState } from 'Models';
|
import { LoadingState } from 'Models';
|
||||||
import React, { FunctionComponent, useState } from 'react';
|
import React, { FunctionComponent, useMemo, useState } from 'react';
|
||||||
import { useHistory, useParams } from 'react-router-dom';
|
import { useHistory, useParams } from 'react-router-dom';
|
||||||
import { useAuthContext } from '../../authentication/auth-provider/AuthProvider';
|
|
||||||
import { addWebhook } from '../../axiosAPIs/webhookAPI';
|
import { addWebhook } from '../../axiosAPIs/webhookAPI';
|
||||||
import AddWebhook from '../../components/AddWebhook/AddWebhook';
|
import AddWebhook from '../../components/AddWebhook/AddWebhook';
|
||||||
import PageContainerV1 from '../../components/containers/PageContainerV1';
|
import PageContainerV1 from '../../components/containers/PageContainerV1';
|
||||||
|
import { usePermissionProvider } from '../../components/PermissionProvider/PermissionProvider';
|
||||||
|
import { ResourceEntity } from '../../components/PermissionProvider/PermissionProvider.interface';
|
||||||
import {
|
import {
|
||||||
GlobalSettingOptions,
|
GlobalSettingOptions,
|
||||||
GlobalSettingsMenuCategory,
|
GlobalSettingsMenuCategory,
|
||||||
@ -28,8 +29,9 @@ import {
|
|||||||
CreateWebhook,
|
CreateWebhook,
|
||||||
WebhookType,
|
WebhookType,
|
||||||
} from '../../generated/api/events/createWebhook';
|
} from '../../generated/api/events/createWebhook';
|
||||||
import { useAuth } from '../../hooks/authHooks';
|
import { Operation } from '../../generated/entity/policies/policy';
|
||||||
import jsonData from '../../jsons/en';
|
import jsonData from '../../jsons/en';
|
||||||
|
import { checkPermission } from '../../utils/PermissionsUtils';
|
||||||
import { getSettingPath } from '../../utils/RouterUtils';
|
import { getSettingPath } from '../../utils/RouterUtils';
|
||||||
import { showErrorToast } from '../../utils/ToastUtils';
|
import { showErrorToast } from '../../utils/ToastUtils';
|
||||||
|
|
||||||
@ -40,14 +42,19 @@ const HEADER_TEXT_WEBHOOK: { [key: string]: string } = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const AddWebhookPage: FunctionComponent = () => {
|
const AddWebhookPage: FunctionComponent = () => {
|
||||||
const { isAdminUser } = useAuth();
|
|
||||||
const { isAuthDisabled } = useAuthContext();
|
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const params = useParams<{ webhookType?: WebhookType }>();
|
const params = useParams<{ webhookType?: WebhookType }>();
|
||||||
|
const { permissions } = usePermissionProvider();
|
||||||
|
|
||||||
const webhookType: WebhookType = params.webhookType ?? WebhookType.Generic;
|
const webhookType: WebhookType = params.webhookType ?? WebhookType.Generic;
|
||||||
const [status, setStatus] = useState<LoadingState>('initial');
|
const [status, setStatus] = useState<LoadingState>('initial');
|
||||||
|
|
||||||
|
const createPermission = useMemo(
|
||||||
|
() =>
|
||||||
|
checkPermission(Operation.Create, ResourceEntity.WEBHOOK, permissions),
|
||||||
|
[permissions]
|
||||||
|
);
|
||||||
|
|
||||||
const goToWebhooks = () => {
|
const goToWebhooks = () => {
|
||||||
switch (webhookType) {
|
switch (webhookType) {
|
||||||
case WebhookType.Slack: {
|
case WebhookType.Slack: {
|
||||||
@ -111,7 +118,7 @@ const AddWebhookPage: FunctionComponent = () => {
|
|||||||
<PageContainerV1>
|
<PageContainerV1>
|
||||||
<div className="tw-self-center">
|
<div className="tw-self-center">
|
||||||
<AddWebhook
|
<AddWebhook
|
||||||
allowAccess={isAdminUser || isAuthDisabled}
|
allowAccess={createPermission}
|
||||||
header={`Add ${HEADER_TEXT_WEBHOOK[webhookType]}`}
|
header={`Add ${HEADER_TEXT_WEBHOOK[webhookType]}`}
|
||||||
mode={FormSubmitType.ADD}
|
mode={FormSubmitType.ADD}
|
||||||
saveState={status}
|
saveState={status}
|
||||||
|
@ -13,9 +13,8 @@
|
|||||||
|
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import { LoadingState } from 'Models';
|
import { LoadingState } from 'Models';
|
||||||
import React, { FunctionComponent, useEffect, useState } from 'react';
|
import React, { FunctionComponent, useEffect, useMemo, useState } from 'react';
|
||||||
import { useHistory, useParams } from 'react-router-dom';
|
import { useHistory, useParams } from 'react-router-dom';
|
||||||
import { useAuthContext } from '../../authentication/auth-provider/AuthProvider';
|
|
||||||
import {
|
import {
|
||||||
deleteWebhook,
|
deleteWebhook,
|
||||||
getWebhookByName,
|
getWebhookByName,
|
||||||
@ -24,6 +23,8 @@ import {
|
|||||||
import AddWebhook from '../../components/AddWebhook/AddWebhook';
|
import AddWebhook from '../../components/AddWebhook/AddWebhook';
|
||||||
import PageContainerV1 from '../../components/containers/PageContainerV1';
|
import PageContainerV1 from '../../components/containers/PageContainerV1';
|
||||||
import Loader from '../../components/Loader/Loader';
|
import Loader from '../../components/Loader/Loader';
|
||||||
|
import { usePermissionProvider } from '../../components/PermissionProvider/PermissionProvider';
|
||||||
|
import { ResourceEntity } from '../../components/PermissionProvider/PermissionProvider.interface';
|
||||||
import {
|
import {
|
||||||
GlobalSettingOptions,
|
GlobalSettingOptions,
|
||||||
GlobalSettingsMenuCategory,
|
GlobalSettingsMenuCategory,
|
||||||
@ -31,8 +32,9 @@ import {
|
|||||||
import { FormSubmitType } from '../../enums/form.enum';
|
import { FormSubmitType } from '../../enums/form.enum';
|
||||||
import { CreateWebhook } from '../../generated/api/events/createWebhook';
|
import { CreateWebhook } from '../../generated/api/events/createWebhook';
|
||||||
import { Webhook, WebhookType } from '../../generated/entity/events/webhook';
|
import { Webhook, WebhookType } from '../../generated/entity/events/webhook';
|
||||||
import { useAuth } from '../../hooks/authHooks';
|
import { Operation } from '../../generated/entity/policies/policy';
|
||||||
import jsonData from '../../jsons/en';
|
import jsonData from '../../jsons/en';
|
||||||
|
import { checkPermission } from '../../utils/PermissionsUtils';
|
||||||
import { getSettingPath } from '../../utils/RouterUtils';
|
import { getSettingPath } from '../../utils/RouterUtils';
|
||||||
import { showErrorToast, showSuccessToast } from '../../utils/ToastUtils';
|
import { showErrorToast, showSuccessToast } from '../../utils/ToastUtils';
|
||||||
|
|
||||||
@ -44,14 +46,25 @@ const EDIT_HEADER_WEBHOOKS_TITLE: { [key: string]: string } = {
|
|||||||
|
|
||||||
const EditWebhookPage: FunctionComponent = () => {
|
const EditWebhookPage: FunctionComponent = () => {
|
||||||
const { webhookName } = useParams<{ [key: string]: string }>();
|
const { webhookName } = useParams<{ [key: string]: string }>();
|
||||||
const { isAdminUser } = useAuth();
|
|
||||||
const { isAuthDisabled } = useAuthContext();
|
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
const { permissions } = usePermissionProvider();
|
||||||
const [isLoading, setIsLoading] = useState<boolean>(true);
|
const [isLoading, setIsLoading] = useState<boolean>(true);
|
||||||
const [webhookData, setWebhookData] = useState<Webhook>();
|
const [webhookData, setWebhookData] = useState<Webhook>();
|
||||||
const [status, setStatus] = useState<LoadingState>('initial');
|
const [status, setStatus] = useState<LoadingState>('initial');
|
||||||
const [deleteStatus, setDeleteStatus] = useState<LoadingState>('initial');
|
const [deleteStatus, setDeleteStatus] = useState<LoadingState>('initial');
|
||||||
|
|
||||||
|
const createPermission = useMemo(
|
||||||
|
() =>
|
||||||
|
checkPermission(Operation.Create, ResourceEntity.WEBHOOK, permissions),
|
||||||
|
[permissions]
|
||||||
|
);
|
||||||
|
|
||||||
|
const editPermission = useMemo(
|
||||||
|
() =>
|
||||||
|
checkPermission(Operation.EditAll, ResourceEntity.WEBHOOK, permissions),
|
||||||
|
[permissions]
|
||||||
|
);
|
||||||
|
|
||||||
const fetchWebhook = () => {
|
const fetchWebhook = () => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
getWebhookByName(webhookName)
|
getWebhookByName(webhookName)
|
||||||
@ -143,7 +156,7 @@ const EditWebhookPage: FunctionComponent = () => {
|
|||||||
<div className="tw-self-center">
|
<div className="tw-self-center">
|
||||||
{!isLoading ? (
|
{!isLoading ? (
|
||||||
<AddWebhook
|
<AddWebhook
|
||||||
allowAccess={isAdminUser || isAuthDisabled}
|
allowAccess={createPermission || editPermission}
|
||||||
data={webhookData}
|
data={webhookData}
|
||||||
deleteState={deleteStatus}
|
deleteState={deleteStatus}
|
||||||
header={
|
header={
|
||||||
|
@ -375,56 +375,23 @@ const AuthenticatedAppRouter: FunctionComponent = () => {
|
|||||||
component={MlModelPage}
|
component={MlModelPage}
|
||||||
path={ROUTES.MLMODEL_DETAILS_WITH_TAB}
|
path={ROUTES.MLMODEL_DETAILS_WITH_TAB}
|
||||||
/>
|
/>
|
||||||
<AdminProtectedRoute
|
<Route exact component={AddGlossaryPage} path={ROUTES.ADD_GLOSSARY} />
|
||||||
exact
|
<Route
|
||||||
component={AddGlossaryPage}
|
|
||||||
hasPermission={checkPermission(
|
|
||||||
Operation.Create,
|
|
||||||
ResourceEntity.GLOSSARY,
|
|
||||||
permissions
|
|
||||||
)}
|
|
||||||
path={ROUTES.ADD_GLOSSARY}
|
|
||||||
/>
|
|
||||||
<AdminProtectedRoute
|
|
||||||
exact
|
exact
|
||||||
component={AddGlossaryTermPage}
|
component={AddGlossaryTermPage}
|
||||||
hasPermission={checkPermission(
|
|
||||||
Operation.Create,
|
|
||||||
ResourceEntity.GLOSSARY_TERM,
|
|
||||||
permissions
|
|
||||||
)}
|
|
||||||
path={ROUTES.ADD_GLOSSARY_TERMS_CHILD}
|
path={ROUTES.ADD_GLOSSARY_TERMS_CHILD}
|
||||||
/>
|
/>
|
||||||
<AdminProtectedRoute
|
<Route
|
||||||
exact
|
exact
|
||||||
component={AddGlossaryTermPage}
|
component={AddGlossaryTermPage}
|
||||||
hasPermission={checkPermission(
|
|
||||||
Operation.Create,
|
|
||||||
ResourceEntity.GLOSSARY_TERM,
|
|
||||||
permissions
|
|
||||||
)}
|
|
||||||
path={ROUTES.ADD_GLOSSARY_TERMS}
|
path={ROUTES.ADD_GLOSSARY_TERMS}
|
||||||
/>
|
/>
|
||||||
<AdminProtectedRoute
|
<Route
|
||||||
exact
|
exact
|
||||||
component={AddWebhookPage}
|
component={AddWebhookPage}
|
||||||
hasPermission={checkPermission(
|
|
||||||
Operation.Create,
|
|
||||||
ResourceEntity.WEBHOOK,
|
|
||||||
permissions
|
|
||||||
)}
|
|
||||||
path={ROUTES.ADD_WEBHOOK_WITH_TYPE}
|
path={ROUTES.ADD_WEBHOOK_WITH_TYPE}
|
||||||
/>
|
/>
|
||||||
<AdminProtectedRoute
|
<Route exact component={AddWebhookPage} path={ROUTES.ADD_WEBHOOK} />
|
||||||
exact
|
|
||||||
component={AddWebhookPage}
|
|
||||||
hasPermission={checkPermission(
|
|
||||||
Operation.Create,
|
|
||||||
ResourceEntity.WEBHOOK,
|
|
||||||
permissions
|
|
||||||
)}
|
|
||||||
path={ROUTES.ADD_WEBHOOK}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<AdminProtectedRoute
|
<AdminProtectedRoute
|
||||||
exact
|
exact
|
||||||
@ -488,26 +455,8 @@ const AuthenticatedAppRouter: FunctionComponent = () => {
|
|||||||
)}
|
)}
|
||||||
path={ROUTES.ADD_POLICY}
|
path={ROUTES.ADD_POLICY}
|
||||||
/>
|
/>
|
||||||
<AdminProtectedRoute
|
<Route exact component={AddRulePage} path={ROUTES.ADD_POLICY_RULE} />
|
||||||
exact
|
<Route exact component={EditRulePage} path={ROUTES.EDIT_POLICY_RULE} />
|
||||||
component={AddRulePage}
|
|
||||||
hasPermission={checkPermission(
|
|
||||||
Operation.EditAll,
|
|
||||||
ResourceEntity.POLICY,
|
|
||||||
permissions
|
|
||||||
)}
|
|
||||||
path={ROUTES.ADD_POLICY_RULE}
|
|
||||||
/>
|
|
||||||
<AdminProtectedRoute
|
|
||||||
exact
|
|
||||||
component={EditRulePage}
|
|
||||||
hasPermission={checkPermission(
|
|
||||||
Operation.EditAll,
|
|
||||||
ResourceEntity.POLICY,
|
|
||||||
permissions
|
|
||||||
)}
|
|
||||||
path={ROUTES.EDIT_POLICY_RULE}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Route exact component={GlobalSettingPage} path={ROUTES.SETTINGS} />
|
<Route exact component={GlobalSettingPage} path={ROUTES.SETTINGS} />
|
||||||
<Route
|
<Route
|
||||||
|
Loading…
x
Reference in New Issue
Block a user