for (Session session : sessions) {
String ejbName = session.getEjbName();
// Found the bean to analyze
if (beanName.equals(ejbName)) {
RunAs runAs = session.getRunAs();
if (runAs != null) {
// Found the principal name to use with the current bean
String beanPincipalName = runAs.getPrincipalName();
principal = new JPrincipal(beanPincipalName);
// Read security role mappings to get all roles for the principal name identity
for (SecurityRoleMapping securityRoleMapping : easyBeansDD.getSecurityRoleMappings()) {
for (String pincipalName : securityRoleMapping.getPrincipalNames()) {