Esempio n. 1
0
 public User getUserWithRole(za.org.rfm.utils.Role role) {
   for (User user : getUsers()) {
     for (UserRole userRole : user.getUserRoles()) {
       if (userRole.getRole().getName().equalsIgnoreCase(role.name())) {
         return user;
       }
     }
   }
   return null;
 }
Esempio n. 2
0
 public List<User> getUsersWithRole(za.org.rfm.utils.Role role) {
   List<User> userList = new ArrayList<User>();
   for (User user : getUsers()) {
     for (UserRole userRole : user.getUserRoles()) {
       if (userRole.getRole().getName().equalsIgnoreCase(role.name())) {
         userList.add(user);
       }
     }
   }
   return userList;
 }