package service.impl;
import java.util.LinkedHashSet;
import java.util.Set;
import model.User;
import service.UserManager;
public class UserManagerImpl implements UserManager {
@Override
public User loadUser(String username, String password) {
if ("111111".equals(username) && "111111".equals(password)) {
return new User("111111", "111111");
}
if ("222222".equals(username) && "222222".equals(password)) {
return new User("222222", "222222");
}
return null;
}
@Override
public Set<String> getPermission(String username) {
Set<String> set = new LinkedHashSet<String>();
if ("111111".equals(username)) {
set.clear();
set.add("aa:xxx");
}
if ("222222".equals(username)) {
set.clear();
set.add("aa:yyy");
}
return set;
}
}