Exemple #1
0
 /**
  * 修改用户拥有的角色
  *
  * @param id
  * @param newRoleList
  * @return
  */
 @RequiresPermissions("sys:user:roleUpd")
 @RequestMapping(value = "{id}/updateRole")
 @ResponseBody
 public String updateUserRole(
     @PathVariable("id") Integer id, @RequestBody List<Integer> newRoleList) {
   userRoleService.updateUserRole(id, userRoleService.getRoleIdList(id), newRoleList);
   return "success";
 }
Exemple #2
0
 /**
  * 获取用户拥有的角色ID集合
  *
  * @param id
  * @return
  */
 @RequiresPermissions("sys:user:roleView")
 @RequestMapping(value = "{id}/roleJson")
 @ResponseBody
 public List<Integer> getRoleIdList(@PathVariable("id") Integer id) {
   return userRoleService.getRoleIdList(id);
 }