use of org.camunda.bpm.engine.task.IdentityLink in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskAddGroupIdentityLinkWithUpdatePersmissionOnAnyTask.
public void testProcessTaskAddGroupIdentityLinkWithUpdatePersmissionOnAnyTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, ANY, 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());
}
use of org.camunda.bpm.engine.task.IdentityLink in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskAddCandidateUser.
public void testProcessTaskAddCandidateUser() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, userId, UPDATE);
createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, UPDATE_TASK);
// 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 testProcessTaskAddCandidateGroupWithTaskAssignPermissionOnTask.
public void testProcessTaskAddCandidateGroupWithTaskAssignPermissionOnTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, 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());
}
use of org.camunda.bpm.engine.task.IdentityLink in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskAddCandidateUserWithUpdatePersmissionOnAnyTask.
public void testProcessTaskAddCandidateUserWithUpdatePersmissionOnAnyTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, ANY, 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());
}
use of org.camunda.bpm.engine.task.IdentityLink in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskAddCandidateUserWithGrantTaskAssignAndRevokeUpdatePermissionOnTask.
public void testProcessTaskAddCandidateUserWithGrantTaskAssignAndRevokeUpdatePermissionOnTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, userId, TASK_ASSIGN);
createRevokeAuthorization(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());
}
Aggregations