Package service.impl

Source Code of service.impl.UserManagerImpl

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;
  }

}
TOP

Related Classes of service.impl.UserManagerImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.