TSK-75: Delete a Workbasket

This commit is contained in:
Marcel Lengl 2018-02-05 13:06:08 +01:00
parent 7bdb11c951
commit 9be8d839d3
19 changed files with 466 additions and 119 deletions

View File

@ -188,13 +188,11 @@ public interface TaskService {
* @return TaskSummaryList with all TaskSummaries of a work basket
* @throws WorkbasketNotFoundException
* if a Work basket can´t be located.
* @throws InvalidWorkbasketException
* thrown if the Workbasket specified with workbasketId has a missing required property
* @throws NotAuthorizedException
* if the current user got no rights for reading on this work basket.
*/
List<TaskSummary> getTaskSummariesByWorkbasketKey(String workbasketKey)
throws WorkbasketNotFoundException, InvalidWorkbasketException, NotAuthorizedException;
throws WorkbasketNotFoundException, NotAuthorizedException;
/**
* Returns a not persisted instance of {@link Task}.

View File

@ -5,6 +5,7 @@ import java.util.List;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.WorkbasketInUseException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
import pro.taskana.model.WorkbasketAuthorization;
@ -231,4 +232,20 @@ public interface WorkbasketService {
void removeDistributionTarget(String sourceWorkbasketId, String targetWorkbasketId)
throws NotAuthorizedException;
/**
* Deletes the workbasket by the given ID of it.
*
* @param workbasketId
* Id of the workbasket which should be deleted.
* @throws NotAuthorizedException
* if the current user got no permissions for this interaction.
* @throws WorkbasketNotFoundException
* if the workbasket does not exist.
* @throws WorkbasketInUseException
* if the workbasket does contain task-content.
* @throws InvalidArgumentException
* if the workbasketId is NULL or EMPTY
*/
void deleteWorkbasket(String workbasketId)
throws NotAuthorizedException, WorkbasketNotFoundException, WorkbasketInUseException, InvalidArgumentException;
}

View File

@ -0,0 +1,16 @@
package pro.taskana.exceptions;
import pro.taskana.Workbasket;
/**
* Thrown, when a workbasket does already exits, but wanted to create with same ID.
*/
public class WorkbasketAlreadyExistException extends TaskanaException {
private static final long serialVersionUID = 6115013L;
public WorkbasketAlreadyExistException(Workbasket workbasket) {
super("ID='" + workbasket.getId() + "', KEY=' " + workbasket.getKey() + "', DOMAIN='"
+ workbasket.getDomain() + "';");
}
}

View File

@ -0,0 +1,13 @@
package pro.taskana.exceptions;
/**
* Thrown if a specific Workbasket does have content and should be deleted.
*/
public class WorkbasketInUseException extends TaskanaException {
public WorkbasketInUseException(String msg) {
super(msg);
}
private static final long serialVersionUID = 1234L;
}

View File

@ -411,7 +411,7 @@ public class TaskServiceImpl implements TaskService {
@Override
public List<TaskSummary> getTaskSummariesByWorkbasketKey(String workbasketKey)
throws WorkbasketNotFoundException, InvalidWorkbasketException, NotAuthorizedException {
throws WorkbasketNotFoundException, NotAuthorizedException {
LOGGER.debug("entry to getTaskSummariesByWorkbasketId(workbasketId = {}", workbasketKey);
List<TaskSummary> results = new ArrayList<>();
try {

View File

@ -9,6 +9,7 @@ import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pro.taskana.TaskSummary;
import pro.taskana.TaskanaEngine;
import pro.taskana.Workbasket;
import pro.taskana.WorkbasketAccessItem;
@ -19,6 +20,7 @@ import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.SystemException;
import pro.taskana.exceptions.WorkbasketInUseException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
import pro.taskana.impl.util.IdGenerator;
import pro.taskana.impl.util.LoggerUtils;
@ -412,7 +414,7 @@ public class WorkbasketServiceImpl implements WorkbasketService {
// check existence of source workbasket
WorkbasketImpl sourceWorkbasket = (WorkbasketImpl) getWorkbasket(sourceWorkbasketId);
checkAuthorizationByWorkbasketId(sourceWorkbasketId, WorkbasketAuthorization.READ);
distributionTargetMapper.deleteAllDistributionTargets(sourceWorkbasketId);
distributionTargetMapper.deleteAllDistributionTargetsBySourceId(sourceWorkbasketId);
sourceWorkbasket.setModified(Instant.now());
workbasketMapper.update(sourceWorkbasket);
@ -505,7 +507,38 @@ public class WorkbasketServiceImpl implements WorkbasketService {
taskanaEngine.returnConnection();
LOGGER.debug("exit from addDistributionTarget");
}
}
@Override
public void deleteWorkbasket(String workbasketId)
throws NotAuthorizedException, WorkbasketNotFoundException, WorkbasketInUseException, InvalidArgumentException {
LOGGER.debug("entry to deleteWorkbasket(workbasketId = {})", workbasketId);
try {
taskanaEngine.openConnection();
if (workbasketId == null || workbasketId.isEmpty()) {
throw new InvalidArgumentException("The WorkbasketId can´t be NULL or EMPTY for deleteWorkbasket()");
}
// check if the workbasket does exist and is empty (Task)
Workbasket wb = this.getWorkbasket(workbasketId);
List<TaskSummary> taskUsages = taskanaEngine.getTaskService()
.createTaskQuery()
.workbasketKeyIn(wb.getKey())
.list();
if (taskUsages == null || taskUsages.size() > 0) {
throw new WorkbasketInUseException(
"Workbasket is used on tasks and can´t be deleted. WorkbasketId=" + workbasketId);
}
// delete workbasket and sub-tables
distributionTargetMapper.deleteAllDistributionTargetsBySourceId(wb.getId());
distributionTargetMapper.deleteAllDistributionTargetsByTargetId(wb.getId());
workbasketAccessMapper.deleteAllForWorkbasketkey(wb.getKey());
workbasketMapper.delete(workbasketId);
} finally {
taskanaEngine.returnConnection();
LOGGER.debug("exit from deleteWorkbasket(workbasketId = {})", workbasketId);
}
}
private void checkAuthorizationByWorkbasketId(String workbasketId,
@ -563,5 +596,4 @@ public class WorkbasketServiceImpl implements WorkbasketService {
LOGGER.debug("exit from checkAuthorization(). User is authorized = {}.", isAuthorized);
}
}
}

View File

@ -4,5 +4,22 @@ package pro.taskana.model;
* This enum contains all permission values for the workbaskets.
*/
public enum WorkbasketAuthorization {
READ, OPEN, APPEND, TRANSFER, DISTRIBUTE, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8, CUSTOM_9, CUSTOM_10, CUSTOM_11, CUSTOM_12
READ,
OPEN,
APPEND,
TRANSFER,
DISTRIBUTE,
DELETE,
CUSTOM_1,
CUSTOM_2,
CUSTOM_3,
CUSTOM_4,
CUSTOM_5,
CUSTOM_6,
CUSTOM_7,
CUSTOM_8,
CUSTOM_9,
CUSTOM_10,
CUSTOM_11,
CUSTOM_12
}

View File

@ -25,8 +25,11 @@ public interface DistributionTargetMapper {
int getNumberOfDistributionTargets(@Param("sourceId") String sourceId, @Param("targetId") String targetId);
@Delete("<script>DELETE FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{sourceId} AND TARGET_ID IN (<foreach item='target' collection='targetId' separator=',' > #{target} </foreach>)</script>")
void deleteMultiple(@Param("sourceId") String sourceId, @Param("targetId") List<String> targetId);
void deleteMultipleBySourceId(@Param("sourceId") String sourceId, @Param("targetId") List<String> targetId);
@Delete("DELETE FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{sourceId}")
void deleteAllDistributionTargets(@Param("sourceId") String sourceId);
void deleteAllDistributionTargetsBySourceId(@Param("sourceId") String sourceId);
@Delete("DELETE FROM DISTRIBUTION_TARGETS WHERE TARGET_ID = #{targetId}")
void deleteAllDistributionTargetsByTargetId(@Param("targetId") String targetId);
}

View File

@ -275,7 +275,11 @@ public interface QueryMapper {
+ "<if test=\"authorization.name().equals('CUSTOM_5')\">PERM_CUSTOM_5</if>"
+ "<if test=\"authorization.name().equals('CUSTOM_6')\">PERM_CUSTOM_6</if>"
+ "<if test=\"authorization.name().equals('CUSTOM_7')\">PERM_CUSTOM_7</if>"
+ "<if test=\"authorization.name().equals('CUSTOM_8')\">PERM_CUSTOM_8</if> = 1 "
+ "<if test=\"authorization.name().equals('CUSTOM_8')\">PERM_CUSTOM_8</if>"
+ "<if test=\"authorization.name().equals('CUSTOM_9')\">PERM_CUSTOM_9</if>"
+ "<if test=\"authorization.name().equals('CUSTOM_10')\">PERM_CUSTOM_10</if>"
+ "<if test=\"authorization.name().equals('CUSTOM_11')\">PERM_CUSTOM_11</if>"
+ "<if test=\"authorization.name().equals('CUSTOM_12')\">PERM_CUSTOM_12</if> = 1 "
+ "</if>"
+ "</where>"
+ "</script>")

View File

@ -93,7 +93,7 @@ public interface WorkbasketAccessMapper {
@Result(property = "permCustom12", column = "PERM_CUSTOM_12")})
List<WorkbasketAccessItemImpl> findByWorkbasketKey(@Param("key") String key);
@Insert("INSERT INTO WORKBASKET_ACCESS_LIST (ID, WORKBASKET_KEY, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8, PERM_CUSTOM_9, PERM_CUSTOM_10, PERM_CUSTOM_11, PERM_CUSTOM_12) "
@Insert("INSERT INTO WORKBASKET_ACCESS_LIST (ID, WORKBASKET_KEY, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8, PERM_CUSTOM_9, PERM_CUSTOM_10, PERM_CUSTOM_11, PERM_CUSTOM_12) "
+ "VALUES (#{workbasketAccessItem.id}, #{workbasketAccessItem.workbasketKey}, #{workbasketAccessItem.accessId}, #{workbasketAccessItem.permRead}, #{workbasketAccessItem.permOpen}, #{workbasketAccessItem.permAppend}, #{workbasketAccessItem.permTransfer}, #{workbasketAccessItem.permDistribute}, #{workbasketAccessItem.permCustom1}, #{workbasketAccessItem.permCustom2}, #{workbasketAccessItem.permCustom3}, #{workbasketAccessItem.permCustom4}, #{workbasketAccessItem.permCustom5}, #{workbasketAccessItem.permCustom6}, #{workbasketAccessItem.permCustom7}, #{workbasketAccessItem.permCustom8}, #{workbasketAccessItem.permCustom9}, #{workbasketAccessItem.permCustom10}, #{workbasketAccessItem.permCustom11}, #{workbasketAccessItem.permCustom12})")
@Options(keyProperty = "id", keyColumn = "ID")
void insert(@Param("workbasketAccessItem") WorkbasketAccessItemImpl workbasketAccessItem);
@ -105,6 +105,9 @@ public interface WorkbasketAccessMapper {
@Delete("DELETE FROM WORKBASKET_ACCESS_LIST where id = #{id}")
void delete(@Param("id") String id);
@Delete("DELETE FROM WORKBASKET_ACCESS_LIST where WORKBASKET_KEY = #{workbasketKey}")
void deleteAllForWorkbasketkey(@Param("workbasketKey") String workbasketKey);
@Select("<script>SELECT MAX(PERM_READ) AS P_READ, MAX(PERM_OPEN) AS P_OPEN, MAX(PERM_APPEND) AS P_APPEND, MAX(PERM_TRANSFER) AS P_TRANSFER, MAX(PERM_DISTRIBUTE) AS P_DISTRIBUTE, MAX(PERM_CUSTOM_1) AS P_CUSTOM_1, MAX(PERM_CUSTOM_2) AS P_CUSTOM_2, MAX(PERM_CUSTOM_3) AS P_CUSTOM_3, MAX(PERM_CUSTOM_4) AS P_CUSTOM_4, MAX(PERM_CUSTOM_5) AS P_CUSTOM_5, MAX(PERM_CUSTOM_6) AS P_CUSTOM_6, MAX(PERM_CUSTOM_7) AS P_CUSTOM_7, MAX(PERM_CUSTOM_8) AS P_CUSTOM_8, MAX(PERM_CUSTOM_9) AS P_CUSTOM_9, MAX(PERM_CUSTOM_10) AS P_CUSTOM_10, MAX(PERM_CUSTOM_11) AS P_CUSTOM_11, MAX(PERM_CUSTOM_12) AS P_CUSTOM_12 "
+ "FROM WORKBASKET_ACCESS_LIST "
+ "WHERE WORKBASKET_KEY = #{workbasketKey} "
@ -177,7 +180,7 @@ public interface WorkbasketAccessMapper {
@Param("workbasketKey") String workbasketKey, @Param("accessIds") List<String> accessIds,
@Param("authorization") String authorization);
@Select("<script>SELECT A.ID, A.WORKBASKET_KEY, A.ACCESS_ID, A.PERM_READ, A.PERM_OPEN, A.PERM_APPEND, A.PERM_TRANSFER, A.PERM_DISTRIBUTE, A.PERM_CUSTOM_1, A.PERM_CUSTOM_2, A.PERM_CUSTOM_3, A.PERM_CUSTOM_4, A.PERM_CUSTOM_5, A.PERM_CUSTOM_6, A.PERM_CUSTOM_7, A.PERM_CUSTOM_8 "
@Select("<script>SELECT A.ID, A.WORKBASKET_KEY, A.ACCESS_ID, A.PERM_READ, A.PERM_OPEN, A.PERM_APPEND, A.PERM_TRANSFER, A.PERM_DISTRIBUTE, A.PERM_CUSTOM_1, A.PERM_CUSTOM_2, A.PERM_CUSTOM_3, A.PERM_CUSTOM_4, A.PERM_CUSTOM_5, A.PERM_CUSTOM_6, A.PERM_CUSTOM_7, A.PERM_CUSTOM_8, A.PERM_CUSTOM_9, A.PERM_CUSTOM_10, A.PERM_CUSTOM_11, A.PERM_CUSTOM_12 "
+ "FROM WORKBASKET_ACCESS_LIST AS A "
+ "LEFT JOIN WORKBASKET AS W ON A.WORKBASKET_KEY = W.KEY "
+ "WHERE W.ID = #{workbasketId} "
@ -194,26 +197,12 @@ public interface WorkbasketAccessMapper {
+ "<if test=\"authorization == 'CUSTOM_5'\">PERM_CUSTOM_5</if>"
+ "<if test=\"authorization == 'CUSTOM_6'\">PERM_CUSTOM_6</if>"
+ "<if test=\"authorization == 'CUSTOM_7'\">PERM_CUSTOM_7</if>"
+ "<if test=\"authorization == 'CUSTOM_8'\">PERM_CUSTOM_8</if> = 1</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketKey", column = "WORKBASKET_KEY"),
@Result(property = "accessId", column = "ACCESS_ID"),
@Result(property = "permRead", column = "PERM_READ"),
@Result(property = "permOpen", column = "PERM_OPEN"),
@Result(property = "permAppend", column = "PERM_APPEND"),
@Result(property = "permTransfer", column = "PERM_TRANSFER"),
@Result(property = "permDistribute", column = "PERM_DISTRIBUTE"),
@Result(property = "permCustom1", column = "PERM_CUSTOM_1"),
@Result(property = "permCustom2", column = "PERM_CUSTOM_2"),
@Result(property = "permCustom3", column = "PERM_CUSTOM_3"),
@Result(property = "permCustom4", column = "PERM_CUSTOM_4"),
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"),
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"),
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"),
@Result(property = "permCustom8", column = "PERM_CUSTOM_8")})
+ "<if test=\"authorization == 'CUSTOM_8'\">PERM_CUSTOM_8</if>"
+ "<if test=\"authorization == 'CUSTOM_9'\">PERM_CUSTOM_9</if>"
+ "<if test=\"authorization == 'CUSTOM_10'\">PERM_CUSTOM_10</if>"
+ "<if test=\"authorization == 'CUSTOM_11'\">PERM_CUSTOM_11</if>"
+ "<if test=\"authorization == 'CUSTOM_12'\">PERM_CUSTOM_12</if> = 1</script>")
List<WorkbasketAccessItemImpl> findByWorkbasketAndAccessIdAndAuthorizationsById(
@Param("workbasketId") String workbasketId, @Param("accessIds") List<String> accessIds,
@Param("authorization") String authorization);
}

View File

@ -54,14 +54,13 @@ public interface WorkbasketMapper {
@Result(property = "custom2", column = "CUSTOM_2"),
@Result(property = "custom3", column = "CUSTOM_3"),
@Result(property = "custom4", column = "CUSTOM_4"),
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"),
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"),
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
WorkbasketImpl findByKey(@Param("key") String key);
@Select("SELECT * FROM WORKBASKET WHERE id IN (SELECT TARGET_ID FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{id})")
@Select("SELECT ID, KEY, NAME, DESCRIPTION, OWNER, DOMAIN, TYPE, ORG_LEVEL_1, ORG_LEVEL_2, ORG_LEVEL_3, ORG_LEVEL_4 FROM WORKBASKET WHERE ID IN (SELECT TARGET_ID FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{id})")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@ -70,7 +69,6 @@ public interface WorkbasketMapper {
@Result(property = "owner", column = "OWNER"),
@Result(property = "domain", column = "DOMAIN"),
@Result(property = "type", column = "TYPE"),
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"),
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"),
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
@ -90,7 +88,6 @@ public interface WorkbasketMapper {
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"),
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
List<WorkbasketSummaryImpl> findSummaryByKey(@Param("key") String key);
@Select("SELECT * FROM WORKBASKET ORDER BY id")
@ -124,7 +121,11 @@ public interface WorkbasketMapper {
+ "<if test=\"authorization.name() == 'CUSTOM_5'\">PERM_CUSTOM_5</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_6'\">PERM_CUSTOM_6</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_7'\">PERM_CUSTOM_7</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_8'\">PERM_CUSTOM_8</if> = 1 </foreach> "
+ "<if test=\"authorization.name() == 'CUSTOM_8'\">PERM_CUSTOM_8</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_9'\">PERM_CUSTOM_9</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_10'\">PERM_CUSTOM_10</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_11'\">PERM_CUSTOM_11</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_12'\">PERM_CUSTOM_12</if> = 1 </foreach> "
+ "ORDER BY id</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@ -135,7 +136,6 @@ public interface WorkbasketMapper {
@Result(property = "owner", column = "OWNER"),
@Result(property = "domain", column = "DOMAIN"),
@Result(property = "type", column = "TYPE"),
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"),
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"),
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),

View File

@ -40,7 +40,7 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
private Task task;
private Attachment attachment;
TaskService taskService;
private TaskService taskService;
public UpdateTaskAttachmentsAccTest() {
super();
@ -317,7 +317,6 @@ public class UpdateTaskAttachmentsAccTest extends AbstractAccTest {
task = taskService.getTask(task.getId());
assertThat(task.getAttachments().size(), equalTo(2));
assertThat(task.getAttachments().get(0).getClassificationSummary().getKey(), equalTo("DOCTYPE_DEFAULT"));
assertThat(task.getAttachments().get(1).getCustomAttributes().size(), equalTo(4));
Attachment attachment3 = createAttachment("DOCTYPE_DEFAULT",
createObjectReference("COMPANY_C", "SYSTEM_7", "INSTANCE_7", "ArchiveId",

View File

@ -89,7 +89,5 @@ public class CreateWorkbasketAccTest extends AbstractAccTest {
fail("InvalidWorkbasketException was expected");
} catch (InvalidWorkbasketException e) {
}
}
}

View File

@ -0,0 +1,117 @@
package acceptance.workbasket;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.h2.store.fs.FileUtils;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import acceptance.AbstractAccTest;
import pro.taskana.Workbasket;
import pro.taskana.WorkbasketService;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.WorkbasketInUseException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
import pro.taskana.security.JAASRunner;
import pro.taskana.security.WithAccessId;
/**
* Acceptance test which does test the deletion of a workbasket and all wanted failures.
*/
@RunWith(JAASRunner.class)
public class DeleteWorkbasketAccTest extends AbstractAccTest {
private WorkbasketService workbasketService;
public DeleteWorkbasketAccTest() {
super();
}
@Before
public void setUpMethod() {
workbasketService = taskanaEngine.getWorkbasketService();
}
@WithAccessId(userName = "teamlead_2")
@Test
public void testDeleteWorkbasket()
throws WorkbasketNotFoundException, NotAuthorizedException, WorkbasketInUseException, InvalidArgumentException {
Workbasket wb = workbasketService.getWorkbasketByKey("TEAMLEAD_2");
workbasketService.deleteWorkbasket(wb.getId());
try {
workbasketService.getWorkbasketByKey("TEAMLEAD_2");
fail("There should be no result for a deleted Workbasket.");
} catch (WorkbasketNotFoundException e) {
// Workbasket is deleted
}
}
@WithAccessId(userName = "user_1_1", groupNames = {"teamlead_1", "group_1"})
@Test
public void testDeleteWorkbasketAlsoAsDistributionTarget()
throws WorkbasketNotFoundException, NotAuthorizedException, WorkbasketInUseException, InvalidArgumentException {
Workbasket wb = workbasketService.getWorkbasketByKey("GPK_KSC_1");
int distTargets = workbasketService.getDistributionTargets("WBI:100000000000000000000000000000000001")
.size();
// WB deleted
workbasketService.deleteWorkbasket(wb.getId());
try {
workbasketService.getWorkbasketByKey("GPK_KSC_1");
fail("There should be no result for a deleted Workbasket.");
} catch (WorkbasketNotFoundException e) {
// Workbasket is deleted
}
int newDistTargets = workbasketService.getDistributionTargets("WBI:100000000000000000000000000000000001")
.size();
assertThat(newDistTargets, equalTo(3));
assertTrue(newDistTargets < distTargets);
}
@Test
public void testDeleteWorkbasketWithNullOrEmptyParam()
throws WorkbasketNotFoundException, NotAuthorizedException, WorkbasketInUseException {
// Test Null-Value
try {
workbasketService.deleteWorkbasket(null);
fail("delete() should have thrown an InvalidArgumentException, when the param ID is null.");
} catch (InvalidArgumentException e) {
// Nothing to do here
}
// Test EMPTY-Value
try {
workbasketService.deleteWorkbasket("");
fail("delete() should have thrown an InvalidArgumentException, when the param ID is EMPTY-String.");
} catch (InvalidArgumentException e) {
// Nothing to do here
}
}
@Test(expected = WorkbasketNotFoundException.class)
public void testDeleteWorkbasketButNotExisting()
throws WorkbasketNotFoundException, NotAuthorizedException, WorkbasketInUseException, InvalidArgumentException {
workbasketService.deleteWorkbasket("SOME NOT EXISTING ID");
}
@WithAccessId(userName = "user_1_1")
@Test(expected = WorkbasketInUseException.class)
public void testDeleteWorkbasketWhichIsUsed()
throws WorkbasketNotFoundException, NotAuthorizedException, WorkbasketInUseException, InvalidArgumentException {
Workbasket wb = workbasketService.getWorkbasketByKey("USER_1_1"); // all rights, DOMAIN_A with Tasks
workbasketService.deleteWorkbasket(wb.getId());
}
@AfterClass
public static void cleanUpClass() {
FileUtils.deleteRecursive("~/data", true);
}
}

View File

@ -4,6 +4,7 @@ import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsNot.not;
import static org.hamcrest.core.StringStartsWith.startsWith;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
@ -26,10 +27,15 @@ import org.mockito.MockitoAnnotations;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
import pro.taskana.TaskQuery;
import pro.taskana.TaskService;
import pro.taskana.TaskSummary;
import pro.taskana.Workbasket;
import pro.taskana.configuration.TaskanaEngineConfiguration;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.InvalidWorkbasketException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.WorkbasketInUseException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
import pro.taskana.model.WorkbasketAuthorization;
import pro.taskana.model.WorkbasketType;
@ -58,6 +64,12 @@ public class WorkbasketServiceImplTest {
@Mock
private WorkbasketAccessMapper workbasketAccessMapperMock;
@Mock
private TaskService taskServiceMock;
@Mock
private TaskQuery taskQueryMock;
@Mock
private TaskanaEngineImpl taskanaEngineImplMock;
@ -85,7 +97,8 @@ public class WorkbasketServiceImplTest {
verify(workbasketMapperMock, times(1)).findById(wbId);
verify(cutSpy, times(1)).checkAuthorization(wb.getKey(), authorization);
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
throw ex;
}
@ -103,7 +116,8 @@ public class WorkbasketServiceImplTest {
verify(taskanaEngineImplMock, times(1)).openConnection();
verify(workbasketMapperMock, times(1)).findById(wbId);
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
throw ex;
}
@ -123,7 +137,8 @@ public class WorkbasketServiceImplTest {
verify(workbasketMapperMock, times(1)).findById(wbId);
verify(cutSpy, times(1)).checkAuthorization(wb.getKey(), authorization);
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
assertThat(actualWb, equalTo(wb));
}
@ -144,7 +159,8 @@ public class WorkbasketServiceImplTest {
verify(workbasketMapperMock, times(1)).findByKey(wbKey);
verify(cutSpy, times(1)).checkAuthorization(wbKey, authorization);
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
throw ex;
}
@ -163,7 +179,8 @@ public class WorkbasketServiceImplTest {
verify(taskanaEngineImplMock, times(1)).openConnection();
verify(workbasketMapperMock, times(1)).findByKey(wbKey);
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
throw ex;
}
@ -182,7 +199,8 @@ public class WorkbasketServiceImplTest {
verify(cutSpy, times(1)).checkAuthorization(wbKey, authorization);
verify(workbasketMapperMock, times(1)).findByKey(wbKey);
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
assertThat(actualWb, equalTo(wb));
}
@ -201,7 +219,8 @@ public class WorkbasketServiceImplTest {
} catch (InvalidWorkbasketException ex) {
verify(taskanaEngineImplMock, times(serviceCalls)).openConnection();
verify(taskanaEngineImplMock, times(serviceCalls)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
assertThat(wb.getId(), not(equalTo(null)));
assertThat(wb.getCreated(), not(equalTo(null)));
@ -216,7 +235,8 @@ public class WorkbasketServiceImplTest {
} catch (InvalidWorkbasketException ex) {
verify(taskanaEngineImplMock, times(serviceCalls)).openConnection();
verify(taskanaEngineImplMock, times(serviceCalls)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
assertThat(wb.getId(), not(equalTo(null)));
assertThat(wb.getCreated(), not(equalTo(null)));
@ -232,7 +252,8 @@ public class WorkbasketServiceImplTest {
} catch (InvalidWorkbasketException ex) {
verify(taskanaEngineImplMock, times(serviceCalls)).openConnection();
verify(taskanaEngineImplMock, times(serviceCalls)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
assertThat(wb.getId(), not(equalTo(null)));
assertThat(wb.getCreated(), not(equalTo(null)));
@ -247,7 +268,8 @@ public class WorkbasketServiceImplTest {
} catch (InvalidWorkbasketException ex) {
verify(taskanaEngineImplMock, times(serviceCalls)).openConnection();
verify(taskanaEngineImplMock, times(serviceCalls)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
assertThat(wb.getId(), not(equalTo(null)));
assertThat(wb.getCreated(), not(equalTo(null)));
@ -263,7 +285,8 @@ public class WorkbasketServiceImplTest {
} catch (InvalidWorkbasketException ex) {
verify(taskanaEngineImplMock, times(serviceCalls)).openConnection();
verify(taskanaEngineImplMock, times(serviceCalls)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
assertThat(wb.getId(), not(equalTo(null)));
assertThat(wb.getCreated(), not(equalTo(null)));
@ -279,7 +302,8 @@ public class WorkbasketServiceImplTest {
} catch (InvalidWorkbasketException ex) {
verify(taskanaEngineImplMock, times(serviceCalls)).openConnection();
verify(taskanaEngineImplMock, times(serviceCalls)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
assertThat(wb.getId(), not(equalTo(null)));
assertThat(wb.getCreated(), not(equalTo(null)));
@ -307,8 +331,9 @@ public class WorkbasketServiceImplTest {
verify(workbasketMapperMock, times(2)).findById(expectedWb.getId());
verify(workbasketMapperMock, times(1)).update(any());
verify(taskanaEngineImplMock, times(5)).returnConnection();
verify(distributionTargetMapperMock, times(1)).deleteAllDistributionTargets(any());
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verify(distributionTargetMapperMock, times(1)).deleteAllDistributionTargetsBySourceId(any());
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
assertThat(actualWb.getId(), not(equalTo(null)));
assertThat(actualWb.getId(), startsWith("WBI"));
@ -335,12 +360,13 @@ public class WorkbasketServiceImplTest {
verify(taskanaEngineConfigurationMock, times(1)).isSecurityEnabled();
verify(workbasketMapperMock, times(3)).insert(any());
verify(cutSpy, times(distTargetAmount + 1)).getWorkbasket(any());
verify(distributionTargetMapperMock, times(1)).deleteAllDistributionTargets(any());
verify(distributionTargetMapperMock, times(1)).deleteAllDistributionTargetsBySourceId(any());
verify(distributionTargetMapperMock, times(distTargetAmount)).insert(any(), any());
verify(workbasketMapperMock, times(3)).findById(any());
verify(workbasketMapperMock, times(1)).update(any());
verify(taskanaEngineImplMock, times(5)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
assertThat(actualWb.getId(), not(equalTo(null)));
assertThat(actualWb.getId(), startsWith("WBI"));
@ -351,7 +377,6 @@ public class WorkbasketServiceImplTest {
@Test(expected = WorkbasketNotFoundException.class)
public void testCreateWorkbasket_DistibutionTargetNotExisting()
throws WorkbasketNotFoundException, NotAuthorizedException, InvalidWorkbasketException {
final int distTargetAmount = 5;
WorkbasketImpl expectedWb = createTestWorkbasket("ID-1", "Key-1");
doNothing().when(workbasketMapperMock).insert(expectedWb);
@ -368,7 +393,8 @@ public class WorkbasketServiceImplTest {
verify(workbasketMapperMock, times(2)).findById(any());
verify(cutSpy, times(1)).getWorkbasket(any());
verify(taskanaEngineImplMock, times(3)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
throw e;
}
@ -390,12 +416,115 @@ public class WorkbasketServiceImplTest {
verify(workbasketMapperMock, times(1)).insert(expectedWb);
verify(workbasketMapperMock, times(1)).findById(expectedWb.getId());
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(workbasketMapperMock, workbasketAccessMapperMock, distributionTargetMapperMock,
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
throw e;
}
}
@Test
public void testDeleteWorkbasketWithNullOrEmptyParam()
throws WorkbasketNotFoundException, NotAuthorizedException, WorkbasketInUseException, InvalidArgumentException {
// null param
try {
cutSpy.deleteWorkbasket(null);
fail("delete() should have thrown an InvalidArgumentException, when the param ID is null.");
} catch (InvalidArgumentException e) {
verify(taskanaEngineImplMock, times(1)).openConnection();
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
}
// null param
try {
cutSpy.deleteWorkbasket("");
fail("delete() should have thrown an InvalidArgumentException, when the param ID is EMPTY-String.");
} catch (InvalidArgumentException e) {
verify(taskanaEngineImplMock, times(2)).openConnection();
verify(taskanaEngineImplMock, times(2)).returnConnection();
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
}
}
@Test(expected = WorkbasketNotFoundException.class)
public void testDeleteWorkbasketNotExisting()
throws WorkbasketNotFoundException, NotAuthorizedException, WorkbasketInUseException, InvalidArgumentException {
String workbasketId = "WBI:0";
doThrow(WorkbasketNotFoundException.class).when(cutSpy).getWorkbasket(workbasketId);
try {
cutSpy.deleteWorkbasket(workbasketId);
} catch (WorkbasketNotFoundException e) {
verify(taskanaEngineImplMock, times(1)).openConnection();
verify(cutSpy, times(1)).getWorkbasket(workbasketId);
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
throw e;
}
}
@Test(expected = WorkbasketInUseException.class)
public void testDeleteWorkbasketIsUsed()
throws NotAuthorizedException, WorkbasketInUseException, InvalidArgumentException, WorkbasketNotFoundException {
Workbasket wb = createTestWorkbasket("WBI:0", "wb-key");
List<TaskSummary> usages = Arrays.asList(new TaskSummaryImpl(), new TaskSummaryImpl());
doReturn(wb).when(cutSpy).getWorkbasket(wb.getId());
doReturn(taskServiceMock).when(taskanaEngineImplMock).getTaskService();
doReturn(taskQueryMock).when(taskServiceMock).createTaskQuery();
doReturn(taskQueryMock).when(taskQueryMock).workbasketKeyIn(wb.getKey());
doReturn(usages).when(taskQueryMock).list();
try {
cutSpy.deleteWorkbasket(wb.getId());
} catch (WorkbasketNotFoundException e) {
verify(taskanaEngineImplMock, times(1)).openConnection();
verify(cutSpy, times(1)).getWorkbasket(wb.getId());
verify(taskanaEngineImplMock, times(1)).getTaskService();
verify(taskServiceMock, times(1)).createTaskQuery();
verify(taskQueryMock, times(1)).workbasketKeyIn(wb.getKey());
verify(taskQueryMock, times(1)).list();
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
throw e;
}
}
@Test
public void testDeleteWorkbasket()
throws NotAuthorizedException, WorkbasketInUseException, InvalidArgumentException, WorkbasketNotFoundException {
Workbasket wb = createTestWorkbasket("WBI:0", "wb-key");
doReturn(wb).when(cutSpy).getWorkbasket(wb.getId());
doReturn(taskServiceMock).when(taskanaEngineImplMock).getTaskService();
doReturn(taskQueryMock).when(taskServiceMock).createTaskQuery();
doReturn(taskQueryMock).when(taskQueryMock).workbasketKeyIn(wb.getKey());
doReturn(new ArrayList<>()).when(taskQueryMock).list();
cutSpy.deleteWorkbasket(wb.getId());
verify(taskanaEngineImplMock, times(1)).openConnection();
verify(cutSpy, times(1)).getWorkbasket(wb.getId());
verify(taskanaEngineImplMock, times(1)).getTaskService();
verify(taskServiceMock, times(1)).createTaskQuery();
verify(taskQueryMock, times(1)).workbasketKeyIn(wb.getKey());
verify(taskQueryMock, times(1)).list();
verify(distributionTargetMapperMock, times(1)).deleteAllDistributionTargetsBySourceId(wb.getId());
verify(distributionTargetMapperMock, times(1)).deleteAllDistributionTargetsByTargetId(wb.getId());
verify(workbasketAccessMapperMock, times(1)).deleteAllForWorkbasketkey(wb.getKey());
verify(workbasketMapperMock, times(1)).delete(wb.getId());
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(taskQueryMock, taskServiceMock, workbasketMapperMock, workbasketAccessMapperMock,
distributionTargetMapperMock,
taskanaEngineImplMock, taskanaEngineConfigurationMock);
}
private WorkbasketImpl createTestWorkbasket(String id, String key) {
WorkbasketImpl workbasket = new WorkbasketImpl();
workbasket.setId(id);

View File

@ -1,39 +1,39 @@
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('1', 'key1', 'Elena', true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('2', 'key2', 'Max', true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('3', 'key3', 'Simone', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('4', 'key4', 'user_1_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('1', 'key1', 'Elena', true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('2', 'key2', 'Max', true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('3', 'key3', 'Simone', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('4', 'key4', 'user_1_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
-- KSC authorizations (ID, WB_KEY, ACCESS_ID, READ, OPEN, APPEND, TRANSFER, DISTRIBUTE, C1, .., C8)
-- KSC authorizations ( ID, WB_KEY, ACCESS_ID, READ, OPEN, APPEND, TRANSFER, DISTRIBUTE, C1, .., C12)
-- PPKs
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000001', 'TEAMLEAD_1', 'teamlead_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000002', 'TEAMLEAD_2', 'teamlead_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000003', 'USER_1_1', 'user_1_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000004', 'USER_1_2', 'user_1_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000005', 'USER_2_1', 'user_2_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000006', 'USER_2_2', 'user_2_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000001', 'TEAMLEAD_1', 'teamlead_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000002', 'TEAMLEAD_2', 'teamlead_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000003', 'USER_1_1', 'user_1_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000004', 'USER_1_2', 'user_1_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000005', 'USER_2_1', 'user_2_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000006', 'USER_2_2', 'user_2_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
-- group internal access
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000007', 'TEAMLEAD_1', 'group_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000008', 'TEAMLEAD_2', 'group_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000009', 'USER_1_1', 'group_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000010', 'USER_1_2', 'group_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000011', 'USER_2_1', 'group_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000012', 'USER_2_2', 'group_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000007', 'TEAMLEAD_1', 'group_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000008', 'TEAMLEAD_2', 'group_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000009', 'USER_1_1', 'group_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000010', 'USER_1_2', 'group_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000011', 'USER_2_1', 'group_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000012', 'USER_2_2', 'group_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
-- teamlead substitution
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000013', 'TEAMLEAD_1', 'teamlead_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000014', 'TEAMLEAD_2', 'teamlead_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000013', 'TEAMLEAD_1', 'teamlead_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000014', 'TEAMLEAD_2', 'teamlead_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
-- cross team tranfers
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000015', 'USER_1_1', 'group_2', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000016', 'USER_1_2', 'group_2', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000017', 'USER_2_1', 'group_1', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000018', 'USER_2_2', 'group_1', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000015', 'USER_1_1', 'group_2', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000016', 'USER_1_2', 'group_2', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000017', 'USER_2_1', 'group_1', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000018', 'USER_2_2', 'group_1', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
-- Team GPK access
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000019', 'GPK_KSC_1', 'group_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000020', 'GPK_KSC_2', 'group_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000019', 'GPK_KSC_1', 'group_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000020', 'GPK_KSC_2', 'group_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
-- Cross team GPK access
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000021', 'GPK_KSC', 'teamlead_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000022', 'GPK_KSC', 'teamlead_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000021', 'GPK_KSC', 'teamlead_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000022', 'GPK_KSC', 'teamlead_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
-- Access to other domains
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000023', 'GPK_B_KSC_1', 'group_1', true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000024', 'GPK_B_KSC_2', 'group_2', true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000023', 'GPK_B_KSC_1', 'group_1', true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000024', 'GPK_B_KSC_2', 'group_2', true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);

View File

@ -4,7 +4,7 @@ INSERT INTO WORKBASKET VALUES ('3', 'key3', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP
INSERT INTO WORKBASKET VALUES ('4', 'key4', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Basket4', 'DOMAIN_A', 'TOPIC', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'Max', '', '', '', '', '', '', '', '');
-- KSC workbaskets
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000001', 'GPK_KSC', '2018-02-01T12:00:00', '2018-02-01T12:00:00', 'Gruppenpostkorb KSC', 'DOMAIN_A', 'GROUP', 'Gruppenpostkorb KSC', '', '', '', '', '', '', '', '', '');
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000001', 'GPK_KSC', '2018-02-01 12:00:00', '2018-02-01 12:00:00', 'Gruppenpostkorb KSC', 'DOMAIN_A', 'GROUP', 'Gruppenpostkorb KSC', '', '', '', '', '', '', '', '', '');
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000002', 'GPK_KSC_1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Gruppenpostkorb KSC 1', 'DOMAIN_A', 'GROUP', 'Gruppenpostkorb KSC 1', '', '', '', '', '', '', '', '', '');
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000003', 'GPK_KSC_2', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Gruppenpostkorb KSC 2', 'DOMAIN_A', 'GROUP', 'Gruppenpostkorb KSC 2', '', '', '', '', '', '', '', '', '');
INSERT INTO WORKBASKET VALUES ('WBI:100000000000000000000000000000000004', 'TEAMLEAD_1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'PPK Teamlead KSC 1', 'DOMAIN_A', 'PERSONAL', 'PPK Teamlead KSC 1', '', '', '', '', '', '', '', '', '');

View File

@ -57,6 +57,9 @@ public class WorkbasketController {
case "DISTRIBUTE":
authorizations.add(WorkbasketAuthorization.DISTRIBUTE);
break;
case "DELETE":
authorizations.add(WorkbasketAuthorization.DELETE);
break;
case "CUSTOM_1":
authorizations.add(WorkbasketAuthorization.CUSTOM_1);
break;
@ -81,6 +84,18 @@ public class WorkbasketController {
case "CUSTOM_8":
authorizations.add(WorkbasketAuthorization.CUSTOM_8);
break;
case "CUSTOM_9":
authorizations.add(WorkbasketAuthorization.CUSTOM_9);
break;
case "CUSTOM_10":
authorizations.add(WorkbasketAuthorization.CUSTOM_10);
break;
case "CUSTOM_11":
authorizations.add(WorkbasketAuthorization.CUSTOM_11);
break;
case "CUSTOM_12":
authorizations.add(WorkbasketAuthorization.CUSTOM_12);
break;
}
}
});

View File

@ -1,38 +1,38 @@
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('1', 'key1', 'Elena', true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('2', 'key2', 'Max', true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('3', 'key3', 'Simone', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('1', 'key1', 'Elena', true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('2', 'key2', 'Max', true, true, true, true, true, true, true, true, true, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('3', 'key3', 'Simone', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
-- KSC authorizations (ID, WB_KEY, ACCESS_ID, READ, OPEN, APPEND, TRANSFER, DISTRIBUTE, C1, .., C8)
-- KSC authorizations ( ID, WB_KEY, ACCESS_ID, READ, OPEN, APPEND, TRANSFER, DISTRIBUTE, C1, .., C12)
-- PPKs
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000001', 'TEAMLEAD_1', 'teamlead_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000002', 'TEAMLEAD_2', 'teamlead_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000003', 'USER_1_1', 'user_1_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000004', 'USER_1_2', 'user_1_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000005', 'USER_2_1', 'user_2_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000006', 'USER_2_2', 'user_2_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000001', 'TEAMLEAD_1', 'teamlead_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000002', 'TEAMLEAD_2', 'teamlead_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000003', 'USER_1_1', 'user_1_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000004', 'USER_1_2', 'user_1_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000005', 'USER_2_1', 'user_2_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000006', 'USER_2_2', 'user_2_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
-- group internal access
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000007', 'TEAMLEAD_1', 'group_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000008', 'TEAMLEAD_2', 'group_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000009', 'USER_1_1', 'group_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000010', 'USER_1_2', 'group_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000011', 'USER_2_1', 'group_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000012', 'USER_2_2', 'group_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000007', 'TEAMLEAD_1', 'group_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000008', 'TEAMLEAD_2', 'group_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000009', 'USER_1_1', 'group_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000010', 'USER_1_2', 'group_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000011', 'USER_2_1', 'group_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000012', 'USER_2_2', 'group_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
-- teamlead substitution
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000013', 'TEAMLEAD_1', 'teamlead_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000014', 'TEAMLEAD_2', 'teamlead_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000013', 'TEAMLEAD_1', 'teamlead_2', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000014', 'TEAMLEAD_2', 'teamlead_1', true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
-- cross team tranfers
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000015', 'USER_1_1', 'group_2', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000016', 'USER_1_2', 'group_2', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000017', 'USER_2_1', 'group_1', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000018', 'USER_2_2', 'group_1', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000015', 'USER_1_1', 'group_2', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000016', 'USER_1_2', 'group_2', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000017', 'USER_2_1', 'group_1', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000018', 'USER_2_2', 'group_1', true, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
-- Team GPK access
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000019', 'GPK_KSC_1', 'group_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000020', 'GPK_KSC_2', 'group_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000019', 'GPK_KSC_1', 'group_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000020', 'GPK_KSC_2', 'group_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
-- Cross team GPK access
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000021', 'GPK_KSC', 'teamlead_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000022', 'GPK_KSC', 'teamlead_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000021', 'GPK_KSC', 'teamlead_1', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000022', 'GPK_KSC', 'teamlead_2', true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);
-- Access to other domains
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000023', 'GPK_B_KSC_1', 'group_1', true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000024', 'GPK_B_KSC_2', 'group_2', true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000023', 'GPK_B_KSC_1', 'group_1', true, false, true, true, false, true, false, false, false, false, false, false, false, false, false, false, false, false);
INSERT INTO WORKBASKET_ACCESS_LIST VALUES ('WAI:100000000000000000000000000000000024', 'GPK_B_KSC_2', 'group_2', true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false);