projectGroupUsers = new ArrayList();
for ( Iterator i = users.iterator(); i.hasNext(); )
{
ProjectGroupUserBean pgUser = new ProjectGroupUserBean();
User user = (User) i.next();
pgUser.setUser( user );
pgUser.setProjectGroup( group );
try
{
Collection effectiveRoles = rbac.getEffectivelyAssignedRoles( user.getUsername() );
for ( Iterator j = effectiveRoles.iterator(); j.hasNext(); )
{
Role role = (Role) j.next();
if ( role.getName().indexOf( projectGroup.getName() ) > -1 )
{
pgUser.setRoles( effectiveRoles );
projectGroupUsers.add( pgUser );
break;
}
}
}
catch ( RbacObjectNotFoundException e )
{
pgUser.setRoles( Collections.EMPTY_LIST );
}
catch ( RbacManagerException e )
{
pgUser.setRoles( Collections.EMPTY_LIST );
}
}
}