mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-01-14 11:34:29 +00:00
some more perm updates for core user w/ burnettk
This commit is contained in:
parent
ee61e43237
commit
4143aae16b
@ -85,6 +85,16 @@ permissions:
|
|||||||
users: []
|
users: []
|
||||||
allowed_permissions: [read]
|
allowed_permissions: [read]
|
||||||
uri: /v1.0/process-models
|
uri: /v1.0/process-models
|
||||||
|
read-process-instance-list:
|
||||||
|
groups: [everybody]
|
||||||
|
users: []
|
||||||
|
allowed_permissions: [read]
|
||||||
|
uri: /v1.0/process-instances
|
||||||
|
read-process-instance-report-list:
|
||||||
|
groups: [everybody]
|
||||||
|
users: []
|
||||||
|
allowed_permissions: [read]
|
||||||
|
uri: /v1.0/process-instances/reports
|
||||||
|
|
||||||
manage-procurement-admin:
|
manage-procurement-admin:
|
||||||
groups: ["Project Lead"]
|
groups: ["Project Lead"]
|
||||||
|
@ -85,6 +85,11 @@ permissions:
|
|||||||
users: []
|
users: []
|
||||||
allowed_permissions: [read]
|
allowed_permissions: [read]
|
||||||
uri: /v1.0/process-models
|
uri: /v1.0/process-models
|
||||||
|
read-process-instance-list:
|
||||||
|
groups: [everybody]
|
||||||
|
users: []
|
||||||
|
allowed_permissions: [read]
|
||||||
|
uri: /v1.0/process-instances
|
||||||
|
|
||||||
manage-procurement-admin:
|
manage-procurement-admin:
|
||||||
groups: ["Project Lead"]
|
groups: ["Project Lead"]
|
||||||
|
@ -12,6 +12,7 @@ export const useUriListForPermissions = () => {
|
|||||||
processInstanceActionPath: `/v1.0/process-models/${params.process_model_id}/process-instances`,
|
processInstanceActionPath: `/v1.0/process-models/${params.process_model_id}/process-instances`,
|
||||||
processInstanceListPath: '/v1.0/process-instances',
|
processInstanceListPath: '/v1.0/process-instances',
|
||||||
processInstanceTaskListPath: `/v1.0/process-instances/${params.process_model_id}/${params.process_instance_id}/tasks`,
|
processInstanceTaskListPath: `/v1.0/process-instances/${params.process_model_id}/${params.process_instance_id}/tasks`,
|
||||||
|
processInstanceReportListPath: '/v1.0/process-instances/reports',
|
||||||
processModelCreatePath: `/v1.0/process-models/${params.process_group_id}`,
|
processModelCreatePath: `/v1.0/process-models/${params.process_group_id}`,
|
||||||
processModelFileCreatePath: `/v1.0/process-models/${params.process_model_id}/files`,
|
processModelFileCreatePath: `/v1.0/process-models/${params.process_model_id}/files`,
|
||||||
processModelFileShowPath: `/v1.0/process-models/${params.process_model_id}/files/${params.file_name}`,
|
processModelFileShowPath: `/v1.0/process-models/${params.process_model_id}/files/${params.file_name}`,
|
||||||
|
@ -2,12 +2,22 @@ import { useEffect, useState } from 'react';
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { Button, Table } from '@carbon/react';
|
import { Button, Table } from '@carbon/react';
|
||||||
import { useParams, Link } from 'react-router-dom';
|
import { useParams, Link } from 'react-router-dom';
|
||||||
|
import { Can } from '@casl/react';
|
||||||
import HttpService from '../services/HttpService';
|
import HttpService from '../services/HttpService';
|
||||||
|
import { useUriListForPermissions } from '../hooks/UriListForPermissions';
|
||||||
|
import { PermissionsToCheck } from '../interfaces';
|
||||||
|
import { usePermissionFetcher } from '../hooks/PermissionService';
|
||||||
|
|
||||||
export default function ProcessInstanceReportList() {
|
export default function ProcessInstanceReportList() {
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const [processInstanceReports, setProcessInstanceReports] = useState([]);
|
const [processInstanceReports, setProcessInstanceReports] = useState([]);
|
||||||
|
|
||||||
|
const { targetUris } = useUriListForPermissions();
|
||||||
|
const permissionRequestData: PermissionsToCheck = {
|
||||||
|
[targetUris.processInstanceReportListPath]: ['POST'],
|
||||||
|
};
|
||||||
|
const { ability } = usePermissionFetcher(permissionRequestData);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
HttpService.makeCallToBackend({
|
HttpService.makeCallToBackend({
|
||||||
path: `/process-instances/reports`,
|
path: `/process-instances/reports`,
|
||||||
@ -45,9 +55,11 @@ export default function ProcessInstanceReportList() {
|
|||||||
const headerStuff = (
|
const headerStuff = (
|
||||||
<>
|
<>
|
||||||
<h1>Process Instance Perspectives</h1>
|
<h1>Process Instance Perspectives</h1>
|
||||||
<Button href="/admin/process-instances/reports/new">
|
<Can I="POST" a={targetUris.processInstanceListPath} ability={ability}>
|
||||||
Add a process instance perspective
|
<Button href="/admin/process-instances/reports/new">
|
||||||
</Button>
|
Add a process instance perspective
|
||||||
|
</Button>
|
||||||
|
</Can>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
if (processInstanceReports?.length > 0) {
|
if (processInstanceReports?.length > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user