use of org.camunda.bpm.engine.task.IdentityLink in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testStandaloneTaskAddCandidateUser.
public void testStandaloneTaskAddCandidateUser() {
// given
String taskId = "myTask";
createTask(taskId);
createGrantAuthorization(TASK, taskId, userId, UPDATE);
// 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());
deleteTask(taskId, true);
}
use of org.camunda.bpm.engine.task.IdentityLink in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskAddCandidateUserWithTaskAssignPermissionOnTask.
public void testProcessTaskAddCandidateUserWithTaskAssignPermissionOnTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, 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 testStandaloneTaskAddGroupIdentityLink.
public void testStandaloneTaskAddGroupIdentityLink() {
// given
String taskId = "myTask";
createTask(taskId);
createGrantAuthorization(TASK, taskId, userId, UPDATE);
// when
taskService.addGroupIdentityLink(taskId, "accounting", 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("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 testProcessTaskAddCandidateGroupWithUpdatePersmissionOnAnyTask.
public void testProcessTaskAddCandidateGroupWithUpdatePersmissionOnAnyTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, ANY, 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());
}
use of org.camunda.bpm.engine.task.IdentityLink in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskAddCandidateGroupWithTaskAssignPermission.
public void testProcessTaskAddCandidateGroupWithTaskAssignPermission() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, userId, TASK_ASSIGN);
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, TASK_ASSIGN);
// 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());
}
Aggregations