Give a meaningful error message when the necessary role is missing
This commit is contained in:
parent
46622825f4
commit
b292fd8023
1 changed files with 1 additions and 0 deletions
|
|
@ -109,6 +109,7 @@ public class AttributeEndpointsResourceProvider implements RealmResourceProvider
|
||||||
|
|
||||||
UserModel authUser = auth.getUser();
|
UserModel authUser = auth.getUser();
|
||||||
if (!authUser.hasRole(authRole)) {
|
if (!authUser.hasRole(authRole)) {
|
||||||
|
LOG.info("User " + authUser.getUsername() + " does not have required role " + authRole.getName());
|
||||||
throw new ForbiddenException("User does not have required auth role.");
|
throw new ForbiddenException("User does not have required auth role.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue