Package com.thinkgem.jeesite.modules.sys.entity

Examples of com.thinkgem.jeesite.modules.sys.entity.Role


  @ModelAttribute("role")
  public Role get(@RequestParam(required=false) String id) {
    if (StringUtils.isNotBlank(id)){
      return systemService.getRole(id);
    }else{
      return new Role();
    }
  }
View Full Code Here


  public String outrole(String userId, String roleId, RedirectAttributes redirectAttributes) {
    if(Global.isDemoMode()){
      addMessage(redirectAttributes, "演示模式,不允许操作!");
      return "redirect:"+Global.getAdminPath()+"/sys/role/assign?id="+roleId;
    }
    Role role = systemService.getRole(roleId);
    User user = systemService.getUser(userId);
    if (user.equals(UserUtils.getUser())) {
      addMessage(redirectAttributes, "无法从角色【" + role.getName() + "】中移除用户【" + user.getName() + "】自己!");
    }else {
      Boolean flag = systemService.outUserInRole(role, userId);
      if (!flag) {
        addMessage(redirectAttributes, "用户【" + user.getName() + "】从角色【" + role.getName() + "】中移除失败!");
      }else {
        addMessage(redirectAttributes, "用户【" + user.getName() + "】从角色【" + role.getName() + "】中移除成功!");
      }     
    }
    return "redirect:"+Global.getAdminPath()+"/sys/role/assign?id="+role.getId();
  }
View Full Code Here

TOP

Related Classes of com.thinkgem.jeesite.modules.sys.entity.Role

Copyright © 2018 www.massapicom. 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.