Skip to content

Commit

Permalink
add auth check for creation of process
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasMGo committed Oct 23, 2023
1 parent 84b9144 commit f03397d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/management-system-v2/components/version-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { get, del, put, usePostAsset } from '@/lib/fetch-data';
import { convertToEditableBpmn } from '@/lib/helpers/processVersioning';
import { asyncForEach, asyncMap } from '@/lib/helpers/javascriptHelpers';
import ProcessCreationButton from './process-creation-button';
import { AuthCan } from '@/lib/iamComponents';

type ConfirmationModalProps = {
show: boolean;
Expand Down Expand Up @@ -196,12 +197,14 @@ const VersionToolbar: React.FC<VersionToolbarProps> = () => {
<>
<div style={{ position: 'absolute', zIndex: 10, padding: '12px', top: '80px' }}>
<Space.Compact size="large" direction="vertical">
<Tooltip title="Create as new process">
<ProcessCreationButton
icon={<PlusOutlined />}
createProcess={createNewProcess}
></ProcessCreationButton>
</Tooltip>
<AuthCan action="create" resource="Process">
<Tooltip title="Create as new process">
<ProcessCreationButton
icon={<PlusOutlined />}
createProcess={createNewProcess}
></ProcessCreationButton>
</Tooltip>
</AuthCan>
<Tooltip title="Make editable">
<Button icon={<FormOutlined />} onClick={openConfirmationModal}></Button>
</Tooltip>
Expand Down

0 comments on commit f03397d

Please sign in to comment.