[minor] use execpetion message instead of empty text, if no restrictable is given for unauthorized access (#2)
This commit is contained in:
parent
0852557aaa
commit
6466157c90
|
@ -30,7 +30,6 @@ import org.slf4j.LoggerFactory;
|
||||||
import li.strolch.exception.StrolchAccessDeniedException;
|
import li.strolch.exception.StrolchAccessDeniedException;
|
||||||
import li.strolch.privilege.model.Restrictable;
|
import li.strolch.privilege.model.Restrictable;
|
||||||
import li.strolch.rest.model.Result;
|
import li.strolch.rest.model.Result;
|
||||||
import li.strolch.utils.helper.StringHelper;
|
|
||||||
|
|
||||||
@Provider
|
@Provider
|
||||||
public class StrolchRestfulExceptionMapper implements ExceptionMapper<Exception> {
|
public class StrolchRestfulExceptionMapper implements ExceptionMapper<Exception> {
|
||||||
|
@ -53,7 +52,9 @@ public class StrolchRestfulExceptionMapper implements ExceptionMapper<Exception>
|
||||||
sb.append(" does not have access to ");
|
sb.append(" does not have access to ");
|
||||||
Restrictable restrictable = e.getRestrictable();
|
Restrictable restrictable = e.getRestrictable();
|
||||||
if (restrictable == null) {
|
if (restrictable == null) {
|
||||||
sb.append(StringHelper.NULL);
|
// sb.append(StringHelper.NULL);
|
||||||
|
// use the message
|
||||||
|
sb.append(e.getMessage());
|
||||||
} else {
|
} else {
|
||||||
sb.append(restrictable.getPrivilegeName());
|
sb.append(restrictable.getPrivilegeName());
|
||||||
sb.append(" - ");
|
sb.append(" - ");
|
||||||
|
|
Loading…
Reference in New Issue