TSK-383: removed InvalidArgumentException from WorkbasketQuery.callerHasPermission()

This commit is contained in:
Holger Hagen 2018-03-20 10:14:29 +01:00 committed by Martin Rojas Miguel Angel
parent 4bc7b6bad1
commit ea7ab903d5
3 changed files with 8 additions and 11 deletions

View File

@ -163,17 +163,14 @@ public interface WorkbasketQuery extends BaseQuery<WorkbasketSummary> {
throws InvalidArgumentException, NotAuthorizedException;
/**
* Setting up the permissions for the accessIds of the CurrentUserContext. READ permissions need to be granted,too
* by default.<br>
* The UserContext-AccessIds and the given permission will throw a Exception if they would be NULL.
* Add condition to query if the caller (one of the accessIds of the caller) has the given permission on the
* workbasket.
*
* @return the current query object.
* @return the updated query.
* @param permission
* which should be used for results.
* @throws InvalidArgumentException
* when permission OR accessIds of the userContext are NULL.
* the permission for the query condition.
*/
WorkbasketQuery callerHasPermission(WorkbasketPermission permission) throws InvalidArgumentException;
WorkbasketQuery callerHasPermission(WorkbasketPermission permission);
/**
* Sort the query result by name.

View File

@ -361,7 +361,7 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
}
@Override
public WorkbasketQuery callerHasPermission(WorkbasketPermission permission) throws InvalidArgumentException {
public WorkbasketQuery callerHasPermission(WorkbasketPermission permission) {
this.permission = permission;
return this;
}

View File

@ -127,7 +127,7 @@ public class QueryWorkbasketByPermissionAccTest extends AbstractAccTest {
groupNames = {"group_1"})
@Test
public void testQueryAllTransferTargetsForUserAndGroupFromSubject()
throws SQLException, NotAuthorizedException, InvalidArgumentException, SystemException {
throws SQLException, NotAuthorizedException, SystemException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.callerHasPermission(WorkbasketPermission.APPEND)
@ -138,7 +138,7 @@ public class QueryWorkbasketByPermissionAccTest extends AbstractAccTest {
@WithAccessId(userName = "user_1_1")
@Test
public void testQueryAllAvailableWorkbasketForOpeningForUserAndGroupFromSubject()
throws SQLException, NotAuthorizedException, InvalidArgumentException {
throws SQLException, NotAuthorizedException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> results = workbasketService.createWorkbasketQuery()
.callerHasPermission(WorkbasketPermission.READ)