use of org.camunda.bpm.engine.task.IdentityLink in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskAddCandidateUserWithTaskAssignPermissionOnProcessDefinition.
public void testProcessTaskAddCandidateUserWithTaskAssignPermissionOnProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, TASK_ASSIGN);
// when
taskService.addCandidateUser(taskId, "demo");
// then
disableAuthorization();
List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
enableAuthorization();
assertNotNull(linksForTask);
assertEquals(1, linksForTask.size());
IdentityLink identityLink = linksForTask.get(0);
assertNotNull(identityLink);
assertEquals("demo", identityLink.getUserId());
assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
use of org.camunda.bpm.engine.task.IdentityLink in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskAddCandidateGroupWithUpdateTasksPersmissionOnProcessDefinition.
public void testProcessTaskAddCandidateGroupWithUpdateTasksPersmissionOnProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, UPDATE_TASK);
// when
taskService.addCandidateGroup(taskId, "accounting");
// then
disableAuthorization();
List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
enableAuthorization();
assertNotNull(linksForTask);
assertEquals(1, linksForTask.size());
IdentityLink identityLink = linksForTask.get(0);
assertNotNull(identityLink);
assertEquals("accounting", identityLink.getGroupId());
assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
use of org.camunda.bpm.engine.task.IdentityLink in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskAddUserIdentityLinkWithTaskAssignPersmissionOnAnyTask.
public void testProcessTaskAddUserIdentityLinkWithTaskAssignPersmissionOnAnyTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, ANY, userId, TASK_ASSIGN);
// when
taskService.addUserIdentityLink(taskId, "demo", IdentityLinkType.CANDIDATE);
// then
disableAuthorization();
List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
enableAuthorization();
assertNotNull(linksForTask);
assertEquals(1, linksForTask.size());
IdentityLink identityLink = linksForTask.get(0);
assertNotNull(identityLink);
assertEquals("demo", identityLink.getUserId());
assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
use of org.camunda.bpm.engine.task.IdentityLink in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testStandaloneTaskAddCandidateGroup.
public void testStandaloneTaskAddCandidateGroup() {
// given
String taskId = "myTask";
createTask(taskId);
createGrantAuthorization(TASK, taskId, userId, UPDATE);
// when
taskService.addCandidateGroup(taskId, "accounting");
// then
disableAuthorization();
List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
enableAuthorization();
assertNotNull(linksForTask);
assertEquals(1, linksForTask.size());
IdentityLink identityLink = linksForTask.get(0);
assertNotNull(identityLink);
assertEquals("accounting", identityLink.getGroupId());
assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
deleteTask(taskId, true);
}
use of org.camunda.bpm.engine.task.IdentityLink in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskAddUserIdentityLinkWithTaskAssignPermissionOnProcessDefinition.
public void testProcessTaskAddUserIdentityLinkWithTaskAssignPermissionOnProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, TASK_ASSIGN);
// when
taskService.addUserIdentityLink(taskId, "demo", IdentityLinkType.CANDIDATE);
// then
disableAuthorization();
List<IdentityLink> linksForTask = taskService.getIdentityLinksForTask(taskId);
enableAuthorization();
assertNotNull(linksForTask);
assertEquals(1, linksForTask.size());
IdentityLink identityLink = linksForTask.get(0);
assertNotNull(identityLink);
assertEquals("demo", identityLink.getUserId());
assertEquals(IdentityLinkType.CANDIDATE, identityLink.getType());
}
Aggregations