}
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
LOG.debug("Retrieving authorization information for {}", principals);
final SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
final User user = userService.load(principals.getPrimaryPrincipal().toString());
final List<String> permissions;
if (null == user) {
permissions = Collections.emptyList();
} else {
permissions = user.getPermissions();
if (permissions != null) {
info.setStringPermissions(Sets.newHashSet(permissions));
}
}
LOG.debug("User {} has permissions: {}", principals, permissions);