protected void initDefaultUserPermissionForTask() { if (defaultUserPermissionForTask == null) { if (Permissions.UPDATE.getName().equals(defaultUserPermissionNameForTask)) { defaultUserPermissionForTask = Permissions.UPDATE; } else if (Permissions.TASK_WORK.getName().equals(defaultUserPermissionNameForTask)) { defaultUserPermissionForTask = Permissions.TASK_WORK; } else { throw LOG.invalidConfigDefaultUserPermissionNameForTask(defaultUserPermissionNameForTask, new String[]{Permissions.UPDATE.getName(), Permissions.TASK_WORK.getName()}); } } }
protected void initDefaultUserPermissionForTask() { if (defaultUserPermissionForTask == null) { if (Permissions.UPDATE.getName().equals(defaultUserPermissionNameForTask)) { defaultUserPermissionForTask = Permissions.UPDATE; } else if (Permissions.TASK_WORK.getName().equals(defaultUserPermissionNameForTask)) { defaultUserPermissionForTask = Permissions.TASK_WORK; } else { throw LOG.invalidConfigDefaultUserPermissionNameForTask(defaultUserPermissionNameForTask, new String[]{Permissions.UPDATE.getName(), Permissions.TASK_WORK.getName()}); } } }
public void testGetRunningActivitiesWithoutAuthorization() { // given startProcessInstanceByKey("process"); try { // when optimizeService.getRunningHistoricActivityInstances(new Date(0L), null, 10); fail("Exception expected: It should not be possible to retrieve the activities"); } catch (AuthorizationException e) { // then String exceptionMessage = e.getMessage(); assertTextPresent(userId, exceptionMessage); assertTextPresent(READ_HISTORY.getName(), exceptionMessage); assertTextPresent(PROCESS_DEFINITION.resourceName(), exceptionMessage); } }
public void testGetCompletedTasksWithoutAuthorization() { // given startProcessInstanceByKey("process"); try { // when optimizeService.getCompletedHistoricTaskInstances(new Date(0L), null, 10); fail("Exception expected: It should not be possible to retrieve the tasks"); } catch (AuthorizationException e) { // then String exceptionMessage = e.getMessage(); assertTextPresent(userId, exceptionMessage); assertTextPresent(READ_HISTORY.getName(), exceptionMessage); assertTextPresent(PROCESS_DEFINITION.resourceName(), exceptionMessage); } }
public void testGetOperationsLogWithoutAuthorization() { // given startProcessInstanceByKey("process"); try { // when optimizeService.getHistoricUserOperationLogs(new Date(0L), null, 10); fail("Exception expected: It should not be possible to retrieve the logs"); } catch (AuthorizationException e) { // then String exceptionMessage = e.getMessage(); assertTextPresent(userId, exceptionMessage); assertTextPresent(READ_HISTORY.getName(), exceptionMessage); assertTextPresent(PROCESS_DEFINITION.resourceName(), exceptionMessage); } }
public void testGetCompletedActivitiesWithoutAuthorization() { // given startProcessInstanceByKey("process"); try { // when optimizeService.getCompletedHistoricActivityInstances(new Date(0L), null, 10); fail("Exception expected: It should not be possible to retrieve the activities"); } catch (AuthorizationException e) { // then String exceptionMessage = e.getMessage(); assertTextPresent(userId, exceptionMessage); assertTextPresent(READ_HISTORY.getName(), exceptionMessage); assertTextPresent(PROCESS_DEFINITION.resourceName(), exceptionMessage); } }
public void testGetRunningProcessInstancesWithoutAuthorization() { // given startProcessInstanceByKey("process"); try { // when optimizeService.getRunningHistoricProcessInstances(new Date(0L), null, 10); fail("Exception expected: It should not be possible to retrieve the activities"); } catch (AuthorizationException e) { // then String exceptionMessage = e.getMessage(); assertTextPresent(userId, exceptionMessage); assertTextPresent(READ_HISTORY.getName(), exceptionMessage); assertTextPresent(PROCESS_DEFINITION.resourceName(), exceptionMessage); } }
public void testSuspendProcessDefinitionByKeyWithoutAuthorization() { // given try { // when repositoryService.suspendProcessDefinitionByKey(ONE_TASK_PROCESS_KEY); fail("Exception expected: It should not be possible to suspend the process definition"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(UPDATE.getName(), message); assertTextPresent(ONE_TASK_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testSubmitStartFormWithoutAuthorization() { // given String processDefinitionId = selectProcessDefinitionByKey(FORM_PROCESS_KEY).getId(); try { // when formService.submitStartForm(processDefinitionId, null); fail("Exception expected: It should not possible to submit a start form"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(CREATE.getName(), message); assertTextPresent(PROCESS_INSTANCE.resourceName(), message); } }
public void testDeleteDeploymentWithoutAuthorization() { // given String deploymentId = createDeployment(null); try { // when repositoryService.deleteDeployment(deploymentId); fail("Exception expected: it should not be possible to delete a deployment"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(DELETE.getName(), message); assertTextPresent(DEPLOYMENT.resourceName(), message); } deleteDeployment(deploymentId); }
public void testGetDeploymentResourcesWithoutAuthorization() { // given String deploymentId = createDeployment(null); try { // when repositoryService.getDeploymentResources(deploymentId); fail("Exception expected: it should not be possible to retrieve deployment resources"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(DEPLOYMENT.resourceName(), message); } deleteDeployment(deploymentId); }
public void testGetStartFormDataWithoutAuthorizations() { // given String processDefinitionId = selectProcessDefinitionByKey(FORM_PROCESS_KEY).getId(); try { // when formService.getStartFormData(processDefinitionId); fail("Exception expected: It should not be possible to get start form data"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(FORM_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testGetTaskFormKeyWithoutAuthorizations() { // given String processDefinitionId = selectProcessDefinitionByKey(FORM_PROCESS_KEY).getId(); try { // when formService.getTaskFormKey(processDefinitionId, "task"); fail("Exception expected: It should not possible to get a task form key"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(FORM_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testGetProcessDefinitionWithoutAuthorizations() { // given String processDefinitionId = selectProcessDefinitionByKey(ONE_TASK_PROCESS_KEY).getId(); try { // when repositoryService.getProcessDefinition(processDefinitionId); fail("Exception expected: It should not be possible to get the process definition"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(ONE_TASK_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testGetProcessModelWithoutAuthorizations() { // given String processDefinitionId = selectProcessDefinitionByKey(ONE_TASK_PROCESS_KEY).getId(); try { // when repositoryService.getProcessModel(processDefinitionId); fail("Exception expected: It should not be possible to get the process model"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(ONE_TASK_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testDecisionDefinitionUpdateTimeToLiveWithoutAuthorizations() { //given ProcessDefinition definition = selectProcessDefinitionByKey(ONE_TASK_PROCESS_KEY); try { //when repositoryService.updateProcessDefinitionHistoryTimeToLive(definition.getId(), 6); fail("Exception expected"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(UPDATE.getName(), message); assertTextPresent(ONE_TASK_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testGetDecisionDiagramWithoutAuthorizations() { // given String decisionDefinitionId = selectDecisionDefinitionByKey(DECISION_DEFINITION_KEY).getId(); try { // when repositoryService.getDecisionDiagram(decisionDefinitionId); fail("Exception expected"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(DECISION_DEFINITION_KEY, message); assertTextPresent(DECISION_DEFINITION.resourceName(), message); } }
public void testGetStartFormVariablesWithoutAuthorization() { // given String processDefinitionId = selectProcessDefinitionByKey(RENDERED_FORM_PROCESS_KEY).getId(); try { // when formService.getStartFormVariables(processDefinitionId); fail("Exception expected: It should not be possible to get start form data"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(RENDERED_FORM_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testGetStartFormKeyWithoutAuthorizations() { // given String processDefinitionId = selectProcessDefinitionByKey(FORM_PROCESS_KEY).getId(); try { // when formService.getStartFormKey(processDefinitionId); fail("Exception expected: It should not possible to get a start form key"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(READ.getName(), message); assertTextPresent(FORM_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }
public void testSuspendByProcessDefinitionIdWithoutAuthorization() { // given String processDefinitionId = selectProcessDefinitionByKey(TIMER_BOUNDARY_PROCESS_KEY).getId(); try { // when managementService.suspendJobDefinitionByProcessDefinitionId(processDefinitionId); fail("Exception expected: It should not be possible to suspend a job definition"); } catch (AuthorizationException e) { // then String message = e.getMessage(); assertTextPresent(userId, message); assertTextPresent(UPDATE.getName(), message); assertTextPresent(TIMER_BOUNDARY_PROCESS_KEY, message); assertTextPresent(PROCESS_DEFINITION.resourceName(), message); } }