Principal principal = principalItem.getValue();
if (realm != null && realm.length() != 0) {
principal = new Principal(principal.getId() + "@" + realm, principal.getName(),
principal.getType());
}
RoleAssignment roleAssignment = new RoleAssignment(principal);
roleAssignment.setRealm(realm);
if ("Include".equals(includeExcludeItem.getValue())) {
roleAssignment.addRoles(rolesItem.getValue());
} else if ("Exclude".equals(includeExcludeItem.getValue())) {
roleAssignment.addExcludes(rolesItem.getValue());
}
presenter.addRoleAssignment(roleAssignment);
}
}
},