diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/authorization_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/authorization_service.py index fea16adf..09c13062 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/authorization_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/authorization_service.py @@ -571,7 +571,7 @@ class AuthorizationService: def set_basic_permissions(cls) -> list[PermissionToAssign]: """Set_basic_permissions.""" permissions_to_assign: list[PermissionToAssign] = [] - permissions_to_assign.append(PermissionToAssign(permission="read", target_uri="/process-instances/for-me")) + permissions_to_assign.append(PermissionToAssign(permission="create", target_uri="/process-instances/for-me")) permissions_to_assign.append(PermissionToAssign(permission="read", target_uri="/process-instances/report-metadata")) permissions_to_assign.append(PermissionToAssign(permission="read", target_uri="/processes")) permissions_to_assign.append(PermissionToAssign(permission="read", target_uri="/processes/callers")) diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_authorization_service.py b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_authorization_service.py index dbdf50a8..2d43963d 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_authorization_service.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_authorization_service.py @@ -290,7 +290,7 @@ class TestAuthorizationService(BaseTest): """Test_explode_permissions_basic.""" expected_permissions = [ ("/process-instances/find-by-id/*", "read"), - ("/process-instances/for-me", "read"), + ("/process-instances/for-me", "create"), ("/process-instances/report-metadata", "read"), ("/process-instances/reports/*", "create"), ("/process-instances/reports/*", "delete"), diff --git a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx index 49b19a5e..8424d270 100644 --- a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx +++ b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx @@ -1311,6 +1311,7 @@ export default function ProcessInstanceListTable({ }} processModels={processModelAvailableItems} selectedItem={processModelSelection} + truncateProcessModelDisplayName /> diff --git a/spiffworkflow-frontend/src/components/ProcessModelSearch.tsx b/spiffworkflow-frontend/src/components/ProcessModelSearch.tsx index 8f135652..9f5b7245 100644 --- a/spiffworkflow-frontend/src/components/ProcessModelSearch.tsx +++ b/spiffworkflow-frontend/src/components/ProcessModelSearch.tsx @@ -9,6 +9,7 @@ type OwnProps = { processModels: ProcessModel[]; selectedItem?: ProcessModel | null; titleText?: string; + truncateProcessModelDisplayName?: boolean; }; export default function ProcessModelSearch({ @@ -16,6 +17,7 @@ export default function ProcessModelSearch({ selectedItem, onChange, titleText = 'Process', + truncateProcessModelDisplayName = false, }: OwnProps) { const getParentGroupsDisplayName = (processModel: ProcessModel) => { if (processModel.parent_groups) { @@ -29,7 +31,11 @@ export default function ProcessModelSearch({ }; const getProcessModelLabelForDisplay = (processModel: ProcessModel) => { - return `${processModel.display_name} (${processModel.id})`; + let processModelId = processModel.id; + if (truncateProcessModelDisplayName) { + processModelId = processModelId.split('/').slice(-2).join('/'); + } + return `${processModel.display_name} (${processModelId})`; }; const getProcessModelLabelForSearch = (processModel: ProcessModel) => {