use of com.peterphi.usermanager.guice.authentication.AuthenticationFailureException in project stdlib by petergeneric.
the class UserUIServiceImpl method rotateAccessKey.
@Override
public Response rotateAccessKey(final int userId, final String nonce) {
nonceStore.validate(NONCE_USE, nonce);
final int localUser = login.getId();
if (localUser != userId && !login.isAdmin())
throw new AuthenticationFailureException("Only a User Admin can rotate access keys another user!");
// Change regular account settings
accountDao.rotateUserAccessKey(userId);
return Response.seeOther(URI.create("/user/" + userId)).build();
}
Aggregations