Merge pull request #54 from BerndBreier/TSK-54

TSK-54 Initial drop
This commit is contained in:
Holger Hagen 2017-12-11 09:04:56 +01:00 committed by GitHub
commit 4bb53c8b79
12 changed files with 542 additions and 7 deletions

View File

@ -0,0 +1,64 @@
package pro.taskana;
import java.util.Date;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.model.Workbasket;
import pro.taskana.model.WorkbasketAuthorization;
/**
* WorkitemQuery for generating dynamic sql.
*/
public interface WorkbasketQuery extends BaseQuery<Workbasket> {
/**
* Add your names to your query.
* @param name
* the names as Strings
* @return the query
*/
WorkbasketQuery name(String... name);
/**
* Add your created-Dates to your query.
* @param created
* @return
*/
WorkbasketQuery created(Date... created);
/**
* Add your modified-Dates to your query.
* @param modified
* @return
*/
WorkbasketQuery modified(Date... created);
/**
* Add your description to your query. It will be compared in SQL with an LIKE.
* If you use a wildcard like % tehn it will be transmitted to the database.
* @param description
* your description
* @return the query
*/
WorkbasketQuery descriptionLike(String description);
/**
* Add the owners to your query.
* @param owners
* the owners as String
* @return the query
*/
WorkbasketQuery owner(String... owners);
/**
* Add the access requested.
* @param permission
* the permissions requested
* @param accessIds
* the accessIds as String
* @return the query
* @throws InvalidArgumentException
*/
WorkbasketQuery access(WorkbasketAuthorization permission, String... accessIds) throws InvalidArgumentException;
}

View File

@ -100,11 +100,18 @@ public interface WorkbasketService {
List<WorkbasketAccessItem> getWorkbasketAuthorizations(String workbasketId);
/**
* This method provides workbaskets via an permission.
* This method returns the workbaskets for which the current user has all permissions
* specified in the permissions list.
*
* @param permission
* as String like in this enum: {@link WorkbasketAuthorization}
* a List of WorkbasketAuthorization enums
* @return all filtered workbaskets
*/
List<Workbasket> getWorkbaskets(List<WorkbasketAuthorization> permission);
/**
* This method provides a query builder for quering the database.
* @return a {@link WorkbasketQuery}
*/
WorkbasketQuery createWorkbasketQuery();
}

View File

@ -0,0 +1,14 @@
package pro.taskana.exceptions;
/**
* This exception is thrown when a method is called with invalid argument.
* @author bbr
*
*/
@SuppressWarnings("serial")
public class InvalidArgumentException extends TaskanaException {
public InvalidArgumentException(String msg) {
super(msg);
}
}

View File

@ -5,6 +5,7 @@ package pro.taskana.exceptions;
* @author bbr
*
*/
@SuppressWarnings("serial")
public class TaskanaException extends Exception {
private static final long serialVersionUID = 123234345123412L;

View File

@ -5,6 +5,7 @@ package pro.taskana.exceptions;
* @author bbr
*
*/
@SuppressWarnings("serial")
public class TaskanaRuntimeException extends RuntimeException {
private static final long serialVersionUID = 1511142769801824L;

View File

@ -0,0 +1,211 @@
package pro.taskana.impl;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pro.taskana.TaskanaEngine;
import pro.taskana.WorkbasketQuery;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.impl.util.LoggerUtils;
import pro.taskana.model.Workbasket;
import pro.taskana.model.WorkbasketAuthorization;
/**
* WorkbasketQuery for generating dynamic SQL.
* @author bbr
*
*/
public class WorkbasketQueryImpl implements WorkbasketQuery {
private static final String LINK_TO_MAPPER = "pro.taskana.model.mappings.QueryMapper.queryWorkbasket";
private static final Logger LOGGER = LoggerFactory.getLogger(WorkbasketQueryImpl.class);
private String[] accessId;
private WorkbasketAuthorization authorization;
private String[] name;
private Date[] created;
private Date[] modified;
private String description;
private String[] owner;
private TaskanaEngineImpl taskanaEngineImpl;
public WorkbasketQueryImpl(TaskanaEngine taskanaEngine) {
this.taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
}
@Override
public WorkbasketQuery name(String... names) {
this.name = names;
return this;
}
@Override
public WorkbasketQuery created(Date... created) {
this.created = created;
return this;
}
@Override
public WorkbasketQuery modified(Date... modified) {
this.modified = modified;
return this;
}
@Override
public WorkbasketQuery descriptionLike(String description) {
this.description = description;
return this;
}
@Override
public WorkbasketQuery owner(String... owners) {
this.owner = owners;
return this;
}
@Override
public WorkbasketQuery access(WorkbasketAuthorization permission, String... accessIds) throws InvalidArgumentException {
if (permission == null) {
throw new InvalidArgumentException("permission must not be null");
}
if (accessIds == null || accessIds.length == 0) {
throw new InvalidArgumentException("accessIds must not be empty");
}
this.authorization = permission;
this.accessId = accessIds;
return this;
}
@Override
public List<Workbasket> list() throws NotAuthorizedException {
LOGGER.debug("entry to list(), this = {}", this);
List<Workbasket> result = null;
try {
taskanaEngineImpl.openConnection();
result = taskanaEngineImpl.getSqlSession().selectList(LINK_TO_MAPPER, this);
return result;
} finally {
taskanaEngineImpl.returnConnection();
if (LOGGER.isDebugEnabled()) {
int numberOfResultObjects = result == null ? 0 : result.size();
LOGGER.debug("exit from list(). Returning {} resulting Objects: {} ", numberOfResultObjects, LoggerUtils.listToString(result));
}
}
}
@Override
public List<Workbasket> list(int offset, int limit) throws NotAuthorizedException {
LOGGER.debug("entry to list(offset = {}, limit = {}), this = {}", offset, limit, this);
List<Workbasket> result = null;
try {
taskanaEngineImpl.openConnection();
RowBounds rowBounds = new RowBounds(offset, limit);
result = taskanaEngineImpl.getSqlSession().selectList(LINK_TO_MAPPER, this, rowBounds);
return result;
} finally {
taskanaEngineImpl.returnConnection();
if (LOGGER.isDebugEnabled()) {
int numberOfResultObjects = result == null ? 0 : result.size();
LOGGER.debug("exit from list(offset,limit). Returning {} resulting Objects: {} ", numberOfResultObjects, LoggerUtils.listToString(result));
}
}
}
@Override
public Workbasket single() throws NotAuthorizedException {
LOGGER.debug("entry to single(), this = {}", this);
Workbasket result = null;
try {
taskanaEngineImpl.openConnection();
result = taskanaEngineImpl.getSqlSession().selectOne(LINK_TO_MAPPER, this);
return result;
} finally {
taskanaEngineImpl.returnConnection();
LOGGER.debug("exit from single(). Returning result {} ", result);
}
}
public String[] getAccessId() {
return accessId;
}
public void setAccessId(String[] accessId) {
this.accessId = accessId;
}
public WorkbasketAuthorization getAuthorization() {
return authorization;
}
public void setAuthorization(WorkbasketAuthorization authorization) {
this.authorization = authorization;
}
public String[] getName() {
return name;
}
public void setName(String[] name) {
this.name = name;
}
public Date[] getCreated() {
return created;
}
public void setCreated(Date[] created) {
this.created = created;
}
public Date[] getModified() {
return modified;
}
public void setModified(Date[] modified) {
this.modified = modified;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String[] getOwner() {
return owner;
}
public void setOwner(String[] owner) {
this.owner = owner;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("WorkbasketQueryImpl [accessId=");
builder.append(Arrays.toString(accessId));
builder.append(", authorization=");
builder.append(authorization);
builder.append(", name=");
builder.append(Arrays.toString(name));
builder.append(", created=");
builder.append(Arrays.toString(created));
builder.append(", modified=");
builder.append(Arrays.toString(modified));
builder.append(", description=");
builder.append(description);
builder.append(", owner=");
builder.append(Arrays.toString(owner));
builder.append(", taskanaEngineImpl=");
builder.append(taskanaEngineImpl);
builder.append("]");
return builder.toString();
}
}

View File

@ -3,6 +3,7 @@ package pro.taskana.impl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pro.taskana.TaskanaEngine;
import pro.taskana.WorkbasketQuery;
import pro.taskana.WorkbasketService;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
@ -304,4 +305,9 @@ public class WorkbasketServiceImpl implements WorkbasketService {
}
}
}
@Override
public WorkbasketQuery createWorkbasketQuery() {
return new WorkbasketQueryImpl(taskanaEngine);
}
}

View File

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

View File

@ -1,5 +1,8 @@
package pro.taskana.model.mappings;
import java.util.List;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
@ -9,10 +12,10 @@ import pro.taskana.impl.ClassificationQueryImpl;
import pro.taskana.impl.ObjectReferenceQueryImpl;
import pro.taskana.impl.TaskQueryImpl;
import pro.taskana.model.ClassificationImpl;
import pro.taskana.impl.WorkbasketQueryImpl;
import pro.taskana.model.ObjectReference;
import pro.taskana.model.Task;
import java.util.List;
import pro.taskana.model.Workbasket;
/**
* This class provides a mapper for all queries.
@ -152,4 +155,51 @@ public interface QueryMapper {
@Result(property = "type", column = "TYPE"),
@Result(property = "value", column = "VALUE") })
List<ObjectReference> queryObjectReference(ObjectReferenceQueryImpl objectReference);
@Select("<script>SELECT w.ID, w.CREATED, w.MODIFIED, w.NAME, w.DESCRIPTION, w.OWNER from WORKBASKET w "
+ "<if test='accessId != null'>LEFT OUTER JOIN WORKBASKET_ACCESS_LIST a on w.ID = a.WORKBASKET_ID</if> "
+ "<where>"
+ "<if test='owner != null'>AND w.OWNER IN(<foreach item='item' collection='owner' separator=',' >#{item}</foreach>)</if> "
+ "<if test='name != null'>AND w.NAME IN(<foreach item='item' collection='name' separator=',' >#{item}</foreach>)</if> "
+ "<if test='created != null'>AND w.CREATED IN(<foreach item='item' collection='created' separator=',' >#{item}</foreach>)</if> "
+ "<if test='modified != null'>AND w.MODIFIED IN(<foreach item='item' collection='modified' separator=',' >#{item}</foreach>)</if> "
+ "<if test='description != null'>AND w.DESCRIPTION like #{description}</if> "
+ "<if test='accessId != null'>AND a.ACCESS_ID IN(<foreach item='item' collection='accessId' separator=',' >#{item}</foreach>)</if> "
+ "<if test='authorization != null'>AND "
+ "<if test=\"authorization.name().equals('OPEN')\">PERM_OPEN</if> "
+ "<if test=\"authorization.name().equals('READ')\">PERM_READ</if>"
+ "<if test=\"authorization.name().equals('APPEND')\">PERM_APPEND</if>"
+ "<if test=\"authorization.name().equals('TRANSFER')\">PERM_TRANSFER</if>"
+ "<if test=\"authorization.name().equals('DISTRIBUTE')\">PERM_DISTRIBUTE</if>"
+ "<if test=\"authorization.name().equals('CUSTOM_1')\">PERM_CUSTOM_1</if>"
+ "<if test=\"authorization.name().equals('CUSTOM_2')\">PERM_CUSTOM_2</if>"
+ "<if test=\"authorization.name().equals('CUSTOM_3')\">PERM_CUSTOM_3</if>"
+ "<if test=\"authorization.name().equals('CUSTOM_4')\">PERM_CUSTOM_4</if>"
+ "<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>"
+ "</where>"
+ "</script>")
@Results({
@Result(property = "id", column = "ID"),
@Result(property = "name", column = "NAME"),
@Result(property = "created", column = "CREATED"),
@Result(property = "modified", column = "MODIFIED"),
@Result(property = "description", column = "DESCRIPTION"),
@Result(property = "owner", column = "OWNER"),
@Result(property = "distributionTargets", column = "id", javaType = List.class, many = @Many(select = "findDistributionTargets"))})
List<Workbasket> queryWorkbasket(WorkbasketQueryImpl workbasketQuery);
@Select("<script>SELECT TARGET_ID from DISTRIBUTION_TARGETS "
+ "<where>"
+ "SOURCE_ID = #{sourceId}"
+ "</where>"
+ "</script>")
@Results(value = {
@Result(property = "distributionTarget", column = "TARGET_ID")})
List<String> findDistributionTargets(String sourceId);
}

View File

@ -109,7 +109,15 @@ public interface WorkbasketAccessMapper {
+ "<if test=\"authorization == 'READ'\">PERM_READ</if>"
+ "<if test=\"authorization == 'APPEND'\">PERM_APPEND</if>"
+ "<if test=\"authorization == 'TRANSFER'\">PERM_TRANSFER</if>"
+ "<if test=\"authorization == 'DISTRIBUTE'\">PERM_DISTRIBUTE</if> = 1</script>")
+ "<if test=\"authorization == 'DISTRIBUTE'\">PERM_DISTRIBUTE</if>"
+ "<if test=\"authorization == 'CUSTOM_1'\">PERM_CUSTOM_1</if>"
+ "<if test=\"authorization == 'CUSTOM_2'\">PERM_CUSTOM_2</if>"
+ "<if test=\"authorization == 'CUSTOM_3'\">PERM_CUSTOM_3</if>"
+ "<if test=\"authorization == 'CUSTOM_4'\">PERM_CUSTOM_4</if>"
+ "<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 = "workbasketId", column = "WORKBASKET_ID"),

View File

@ -50,7 +50,15 @@ public interface WorkbasketMapper {
+ "<if test=\"authorization.name() == 'READ'\">PERM_READ</if>"
+ "<if test=\"authorization.name() == 'APPEND'\">PERM_APPEND</if>"
+ "<if test=\"authorization.name() == 'TRANSFER'\">PERM_TRANSFER</if>"
+ "<if test=\"authorization.name() == 'DISTRIBUTE'\">PERM_DISTRIBUTE</if> = 1 </foreach> "
+ "<if test=\"authorization.name() == 'DISTRIBUTE'\">PERM_DISTRIBUTE</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_1'\">PERM_CUSTOM_1</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_2'\">PERM_CUSTOM_2</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_3'\">PERM_CUSTOM_3</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_4'\">PERM_CUSTOM_4</if>"
+ "<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> "
+ "ORDER BY id</script>")
@Results(value = {
@Result(property = "id", column = "ID"),

View File

@ -1,10 +1,16 @@
package pro.taskana.impl.integration;
import java.io.FileNotFoundException;
import java.security.Principal;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.security.auth.Subject;
import javax.security.auth.login.LoginException;
import javax.sql.DataSource;
@ -17,9 +23,13 @@ import org.junit.Test;
import pro.taskana.TaskanaEngine;
import pro.taskana.TaskanaEngine.ConnectionManagementMode;
import pro.taskana.WorkbasketQuery;
import pro.taskana.WorkbasketService;
import pro.taskana.configuration.TaskanaEngineConfiguration;
import pro.taskana.exceptions.ClassificationNotFoundException;
import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.exceptions.TaskNotFoundException;
import pro.taskana.exceptions.WorkbasketNotFoundException;
import pro.taskana.impl.TaskanaEngineImpl;
import pro.taskana.impl.configuration.DBCleaner;
@ -27,6 +37,9 @@ import pro.taskana.impl.configuration.TaskanaEngineConfigurationTest;
import pro.taskana.impl.util.IdGenerator;
import pro.taskana.model.Workbasket;
import pro.taskana.model.WorkbasketAccessItem;
import pro.taskana.model.WorkbasketAuthorization;
import pro.taskana.security.GroupPrincipal;
import pro.taskana.security.UserPrincipal;
/**
@ -38,6 +51,9 @@ public class WorkbasketServiceImplIntAutocommitTest {
private static final int SLEEP_TIME = 100;
private static final int THREE = 3;
private static final int DIFF1 = 200000;
private static final int DIFF2 = 400000;
static int counter = 0;
private DataSource dataSource;
@ -218,6 +234,155 @@ public class WorkbasketServiceImplIntAutocommitTest {
workBasketService.getWorkbasketAuthorization(accessItem.getId()).getAccessId());
}
@Test
public void testWorkbasketQuery() throws NotAuthorizedException, InvalidArgumentException {
generateSampleDataForQuery();
WorkbasketQuery query1 = workBasketService.createWorkbasketQuery().access(WorkbasketAuthorization.OPEN, "Bernd").name("Basket1");
List<Workbasket> result1 = query1.list();
int numDistTargets = 1 + 1 + 1;
Assert.assertEquals(1, result1.size());
Assert.assertEquals(numDistTargets, result1.get(0).getDistributionTargets().size());
WorkbasketQuery query2 = workBasketService.createWorkbasketQuery().access(WorkbasketAuthorization.OPEN, "Bernd", "Konstantin");
List<Workbasket> result2 = query2.list();
Assert.assertEquals(1, result1.size());
WorkbasketQuery query3 = workBasketService.createWorkbasketQuery().access(WorkbasketAuthorization.CUSTOM_5, "Bernd", "Konstantin");
List<Workbasket> result3 = query3.list();
Assert.assertEquals(0, result3.size());
WorkbasketQuery query4 = workBasketService.createWorkbasketQuery().access(WorkbasketAuthorization.CUSTOM_1, "Bernd");
List<Workbasket> result4 = query4.list();
Assert.assertEquals(0, result3.size());
}
@Test
public void testGetWorkbasketsForCurrentUserAndPermission() throws NotAuthorizedException {
generateSampleDataForQuery();
String userName = "eberhardt";
String[] groupNames = {"group2", "group3"};
List<WorkbasketAuthorization> authorizations = new ArrayList<WorkbasketAuthorization>();
authorizations.add(WorkbasketAuthorization.OPEN);
Assert.assertTrue(1 == getWorkbasketsForPrincipalesAndPermissions(userName, groupNames, authorizations));
userName = "Bernd";
Assert.assertTrue(2 == getWorkbasketsForPrincipalesAndPermissions(userName, groupNames, authorizations));
authorizations.add(WorkbasketAuthorization.CUSTOM_4);
Assert.assertTrue(0 == getWorkbasketsForPrincipalesAndPermissions(userName, groupNames, authorizations));
userName = "Holger";
authorizations = new ArrayList<WorkbasketAuthorization>();
authorizations.add(WorkbasketAuthorization.APPEND);
Assert.assertTrue(1 == getWorkbasketsForPrincipalesAndPermissions(userName, groupNames, authorizations));
}
private int getWorkbasketsForPrincipalesAndPermissions(String userName, String[] groupNames,
List<WorkbasketAuthorization> authorizations) throws NotAuthorizedException {
Subject subject = new Subject();
List<Principal> principalList = new ArrayList<>();
principalList.add(new UserPrincipal(userName));
for (int i = 0; i < groupNames.length; i++) {
principalList.add(new GroupPrincipal(groupNames[i]));
}
subject.getPrincipals().addAll(principalList);
int result = -1;
try {
result = Subject.doAs(subject, new PrivilegedExceptionAction<Integer>() {
public Integer run() throws TaskNotFoundException, FileNotFoundException, NotAuthorizedException, SQLException, WorkbasketNotFoundException, ClassificationNotFoundException {
List<Workbasket> wbsResult = workBasketService.getWorkbaskets(authorizations);
return wbsResult.size();
}
});
} catch (PrivilegedActionException e) {
Throwable cause = e.getCause();
if (cause != null) {
Assert.assertTrue(cause instanceof NotAuthorizedException);
throw (NotAuthorizedException) cause;
}
}
return result;
}
public void generateSampleDataForQuery() {
Date now = new Date();
Workbasket basket2 = new Workbasket();
basket2.setCreated(new Timestamp(now.getTime() - DIFF2));
basket2.setId("2");
basket2.setName("Basket2");
basket2.setOwner("Eberhardt");
workBasketService.createWorkbasket(basket2);
Workbasket basket3 = new Workbasket();
basket3.setCreated(new Timestamp(now.getTime() - DIFF1));
basket3.setId("3");
basket3.setName("Basket3");
basket3.setOwner("Konstantin");
workBasketService.createWorkbasket(basket3);
Workbasket basket4 = new Workbasket();
basket4.setCreated(new Timestamp(now.getTime() - DIFF1));
basket4.setId("4");
basket4.setName("Basket4");
basket4.setOwner("Holger");
workBasketService.createWorkbasket(basket4);
Workbasket basket1 = new Workbasket();
basket1.setCreated(new Timestamp(now.getTime() - DIFF1));
basket1.setId("1");
basket1.setName("Basket1");
basket1.setOwner("Holger");
List<Workbasket> distTargets = new ArrayList<Workbasket>();
distTargets.add(basket2);
distTargets.add(basket3);
distTargets.add(basket4);
basket1.setDistributionTargets(distTargets);
workBasketService.createWorkbasket(basket1);
WorkbasketAccessItem accessItem = new WorkbasketAccessItem();
accessItem.setId(IdGenerator.generateWithPrefix("WAI"));
accessItem.setWorkbasketId("1");
accessItem.setAccessId("Bernd");
accessItem.setPermOpen(true);
accessItem.setPermRead(true);
workBasketService.createWorkbasketAuthorization(accessItem);
WorkbasketAccessItem accessItem2 = new WorkbasketAccessItem();
accessItem2.setId(IdGenerator.generateWithPrefix("WAI"));
accessItem2.setWorkbasketId("2");
accessItem2.setAccessId("Eberhardt");
accessItem2.setPermTransfer(true);
accessItem2.setPermCustom1(true);
workBasketService.createWorkbasketAuthorization(accessItem2);
WorkbasketAccessItem accessItem3 = new WorkbasketAccessItem();
accessItem3.setId(IdGenerator.generateWithPrefix("WAI"));
accessItem3.setWorkbasketId("3");
accessItem3.setAccessId("group2");
accessItem3.setPermCustom4(true);
accessItem3.setPermCustom1(true);
workBasketService.createWorkbasketAuthorization(accessItem3);
WorkbasketAccessItem accessItem4 = new WorkbasketAccessItem();
accessItem4.setId(IdGenerator.generateWithPrefix("WAI"));
accessItem4.setWorkbasketId("1");
accessItem4.setAccessId("group3");
accessItem4.setPermOpen(true);
accessItem4.setPermRead(true);
accessItem4.setPermAppend(true);
workBasketService.createWorkbasketAuthorization(accessItem4);
}
@AfterClass
public static void cleanUpClass() {
FileUtils.deleteRecursive("~/data", true);