{
UnitOfWork uow = module.newUnitOfWork();
try {
String username = getAvailablePrincipal( principals ).toString();
RoleAssignee roleAssignee = findRoleAssignee( uow, username );
if ( roleAssignee == null ) {
LOG.debug( "No authorization info for {}", username );
return null;
}
LOG.debug( "Found role assignee for {}: {}", username, roleAssignee );
Set<String> roleNames = roleAssignee.roleNames();
Set<String> permissionStrings = roleAssignee.permissionStrings();
LOG.debug( "Found role assignee has the following roles: {}", roleNames );
LOG.debug( "Found role assignee has the following permissions: {}", permissionStrings );
SimpleAuthorizationInfo atzInfo = new SimpleAuthorizationInfo( roleNames );
atzInfo.setStringPermissions( permissionStrings );
return atzInfo;