TSK-328: Add userId to NotAuthorizedException

This commit is contained in:
Marcel Lengl 2018-02-28 17:21:54 +01:00 committed by Holger Hagen
parent 8dc00106d0
commit f4c29855d8
3 changed files with 5 additions and 5 deletions

View File

@ -1,13 +1,15 @@
package pro.taskana.exceptions; package pro.taskana.exceptions;
import pro.taskana.security.CurrentUserContext;
/** /**
* This exception is used to communicate a not authorized user. * This exception is used to communicate a not authorized user.
*/ */
public class NotAuthorizedException extends TaskanaException { public class NotAuthorizedException extends TaskanaException {
public NotAuthorizedException(String msg) { public NotAuthorizedException(String msg) {
super(msg); super(msg + " - [CURRENT USER: {'" + CurrentUserContext.getUserid() + "'}]");
} }
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 21235L;
} }

View File

@ -73,6 +73,7 @@ public class CreateWorkbasketAccTest extends AbstractAccTest {
workbasket.setType(WorkbasketType.GROUP); workbasket.setType(WorkbasketType.GROUP);
workbasket.setOrgLevel1("company"); workbasket.setOrgLevel1("company");
workbasketService.createWorkbasket(workbasket); workbasketService.createWorkbasket(workbasket);
fail("NotAuthorizedException should have been thrown"); fail("NotAuthorizedException should have been thrown");
} }

View File

@ -1,6 +1,3 @@
/**
*
*/
package pro.taskana.rest; package pro.taskana.rest;
import java.util.List; import java.util.List;