예제 #1
0
 /**
  * 根据用户名查找其权限
  *
  * @param username
  * @return
  */
 public Set<String> findPermissions(String username) {
   return userDao.findPermissions(username);
 }
예제 #2
0
 /**
  * 根据用户名查找其角色
  *
  * @param username
  * @return
  */
 public Set<String> findRoles(String username) {
   return userDao.findRoles(username);
 }
예제 #3
0
 /**
  * 根据用户名查找用户
  *
  * @param username
  * @return
  */
 public User findByUsername(String username) {
   return userDao.findByUsername(username);
 }
예제 #4
0
 /**
  * 移除用户-角色关系
  *
  * @param userId
  * @param roleIds
  */
 public void uncorrelationRoles(Long userId, Long... roleIds) {
   userDao.uncorrelationRoles(userId, roleIds);
 }
예제 #5
0
 /**
  * 修改密码
  *
  * @param userId
  * @param newPassword
  */
 public void changePassword(Long userId, String newPassword) {
   User user = userDao.findOne(userId);
   user.setPassword(newPassword);
   passwordHelper.encryptPassword(user);
   userDao.updateUser(user);
 }
예제 #6
0
 /**
  * 创建用户
  *
  * @param user
  */
 public User createUser(User user) {
   // 加密密码
   passwordHelper.encryptPassword(user);
   return userDao.createUser(user);
 }