コード例 #1
0
 @Override
 public List<Role> findRolesOfUser(String userName) {
   User user;
   try {
     user = locator.find(User.class).get(userName);
   } catch (Exception e) {
     return Collections.emptyList();
   }
   return user.roles().toList();
 }
コード例 #2
0
 @Override
 public boolean verifyPassword(String userName, String password) {
   User user = null;
   try {
     user = locator.find(User.class).get(userName);
   } catch (Exception e) {
     return false;
   }
   return user.credentials().get().verify(password);
 }