use of pro.taskana.WorkbasketAccessItem in project taskana by Taskana.
the class TaskServiceImplIntAutocommitTest method createWorkbasketWithSecurity.
private void createWorkbasketWithSecurity(Workbasket wb, String accessId, boolean permOpen, boolean permRead, boolean permAppend, boolean permTransfer) throws InvalidArgumentException, NotAuthorizedException {
WorkbasketAccessItem accessItem = workbasketService.newWorkbasketAccessItem(wb.getId(), accessId);
accessItem.setPermOpen(permOpen);
accessItem.setPermRead(permRead);
accessItem.setPermAppend(permAppend);
accessItem.setPermTransfer(permTransfer);
workbasketService.createWorkbasketAccessItem(accessItem);
}
use of pro.taskana.WorkbasketAccessItem in project taskana by Taskana.
the class WorkbasketServiceImplIntAutocommitTest method testInsertWorkbasketAccessUser.
@WithAccessId(userName = "Elena", groupNames = { "businessadmin" })
@Test
public void testInsertWorkbasketAccessUser() throws NotAuthorizedException, InvalidArgumentException {
WorkbasketAccessItem accessItem = workBasketService.newWorkbasketAccessItem("k100000000000000000000000000000000000000", "Arthur Dent");
accessItem.setPermOpen(true);
accessItem.setPermRead(true);
workBasketService.createWorkbasketAccessItem(accessItem);
Assert.assertEquals(1, workBasketService.getWorkbasketAccessItems("k100000000000000000000000000000000000000").size());
}
use of pro.taskana.WorkbasketAccessItem in project taskana by Taskana.
the class WorkbasketServiceImplIntAutocommitTest method createWorkbasketWithSecurity.
private void createWorkbasketWithSecurity(Workbasket wb, String accessId, boolean permOpen, boolean permRead, boolean permAppend, boolean permTransfer) throws InvalidArgumentException, NotAuthorizedException {
WorkbasketAccessItem accessItem = workBasketService.newWorkbasketAccessItem(wb.getId(), accessId);
accessItem.setPermOpen(permOpen);
accessItem.setPermRead(permRead);
accessItem.setPermAppend(permAppend);
accessItem.setPermTransfer(permTransfer);
workBasketService.createWorkbasketAccessItem(accessItem);
}
use of pro.taskana.WorkbasketAccessItem in project taskana by Taskana.
the class TaskServiceImplIntExplicitTest method testCreateTask.
@WithAccessId(userName = "Elena", groupNames = { "businessadmin" })
@Test
public void testCreateTask() throws FileNotFoundException, SQLException, TaskNotFoundException, NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, ClassificationAlreadyExistException, TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException, WorkbasketAlreadyExistException, DomainNotFoundException {
Connection connection = dataSource.getConnection();
taskanaEngineImpl.setConnection(connection);
generateSampleAccessItems();
Task task = this.generateDummyTask();
connection.commit();
WorkbasketAccessItem accessItem = workbasketService.newWorkbasketAccessItem("wb", "Elena");
accessItem.setPermAppend(true);
accessItem.setPermRead(true);
accessItem.setPermOpen(true);
workbasketService.createWorkbasketAccessItem(accessItem);
task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
task = taskServiceImpl.createTask(task);
// needed so that the change is visible in the other session
connection.commit();
TaskanaEngine te2 = taskanaEngineConfiguration.buildTaskanaEngine();
TaskServiceImpl taskServiceImpl2 = (TaskServiceImpl) te2.getTaskService();
Task resultTask = taskServiceImpl2.getTask(task.getId());
Assert.assertNotNull(resultTask);
connection.commit();
}
use of pro.taskana.WorkbasketAccessItem in project taskana by Taskana.
the class TaskServiceImplIntExplicitTest method createWorkbasketWithSecurity.
private void createWorkbasketWithSecurity(Workbasket wb, String accessId, boolean permOpen, boolean permRead, boolean permAppend, boolean permTransfer) throws InvalidArgumentException, NotAuthorizedException {
WorkbasketAccessItem accessItem = workbasketService.newWorkbasketAccessItem(wb.getId(), accessId);
accessItem.setPermOpen(permOpen);
accessItem.setPermRead(permRead);
accessItem.setPermAppend(permAppend);
accessItem.setPermTransfer(permTransfer);
workbasketService.createWorkbasketAccessItem(accessItem);
}
Aggregations