Examples of TSRole


Examples of org.jeecgframework.web.system.pojo.base.TSRole

    TSUser u = ResourceUtil.getSessionUserName();
    // 登陆者的权限
    Set<TSFunction> loginActionlist = new HashSet();// 已有权限菜单
    List<TSRoleUser> rUsers = systemService.findByProperty(TSRoleUser.class, "TSUser.id", u.getId());
    for (TSRoleUser ru : rUsers) {
      TSRole role = ru.getTSRole();
      List<TSRoleFunction> roleFunctionList = systemService.findByProperty(TSRoleFunction.class, "TSRole.id", role.getId());
      if (roleFunctionList.size() > 0) {
        for (TSRoleFunction roleFunction : roleFunctionList) {
          TSFunction function = (TSFunction) roleFunction.getTSFunction();
          loginActionlist.add(function);
        }
View Full Code Here

Examples of org.jeecgframework.web.system.pojo.base.TSRole

  protected void saveRoleUser(TSUser user, String roleidstr) {
    String[] roleids = roleidstr.split(",");
    for (int i = 0; i < roleids.length; i++) {
      TSRoleUser rUser = new TSRoleUser();
      TSRole role = systemService.getEntity(TSRole.class, roleids[i]);
      rUser.setTSRole(role);
      rUser.setTSUser(user);
      systemService.save(rUser);

    }
View Full Code Here

Examples of org.jeecgframework.web.system.pojo.base.TSRole

    String roles = "";
    if (user != null) {
      List<TSRoleUser> rUsers = systemService.findByProperty(
          TSRoleUser.class, "TSUser.id", user.getId());
      for (TSRoleUser ru : rUsers) {
        TSRole role = ru.getTSRole();
        roles += role.getRoleName() + ",";
      }
      if (roles.length() > 0) {
        roles = roles.substring(0, roles.length() - 1);
      }
      request.setAttribute("roleName", roles);
View Full Code Here

Examples of org.jeecgframework.web.system.pojo.base.TSRole

    if (client.getFunctions() == null) {
      Map<String, TSFunction> loginActionlist = new HashMap<String, TSFunction>();
      List<TSRoleUser> rUsers = systemService.findByProperty(
          TSRoleUser.class, "TSUser.id", user.getId());
      for (TSRoleUser ru : rUsers) {
        TSRole role = ru.getTSRole();
        List<TSRoleFunction> roleFunctionList = systemService
            .findByProperty(TSRoleFunction.class, "TSRole.id",
                role.getId());
        for (TSRoleFunction roleFunction : roleFunctionList) {
          TSFunction function = roleFunction.getTSFunction();
          loginActionlist.put(function.getId(), function);
        }
      }
View Full Code Here

Examples of org.jeecgframework.web.system.pojo.base.TSRole

   
    //获取一级菜单列表
    Map<Integer, List<TSFunction>> functionMap = new HashMap<Integer, List<TSFunction>>();
    Map<String, TSFunction> loginActionlist = new HashMap<String, TSFunction>();
    for (TSRoleUser ru : rUsers) {
      TSRole role = ru.getTSRole();
      List<TSRoleFunction> roleFunctionList = systemService
          .findByProperty(TSRoleFunction.class, "TSRole.id",
              role.getId());
      for (TSRoleFunction roleFunction : roleFunctionList) {
        TSFunction function = roleFunction.getTSFunction();
        loginActionlist.put(function.getId(), function);
      }
    }
View Full Code Here

Examples of org.jeecgframework.web.system.pojo.base.TSRole

   */
  @RequestMapping(params = "updateAuthority")
  public String updateAuthority(HttpServletRequest request) {
    Integer roleid = oConvertUtils.getInt(request.getParameter("roleid"), 0);
    String rolefunction = request.getParameter("rolefunctions");
    TSRole role = this.systemService.get(TSRole.class, roleid);
    List<TSRoleFunction> roleFunctionList = systemService.findByProperty(TSRoleFunction.class, "TSRole.id", role.getId());
    systemService.deleteAllEntitie(roleFunctionList);
    String[] roleFunctions = null;
    if (rolefunction != "") {
      roleFunctions = rolefunction.split(",");
      for (String s : roleFunctions) {
View Full Code Here

Examples of org.jeecgframework.web.system.pojo.base.TSRole

  public AjaxJson updateAuthority(HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    try{
      String roleId =request.getParameter("roleId");
      String rolefunction = request.getParameter("rolefunctions");
      TSRole role = this.systemService.get(TSRole.class, roleId);
      List<TSRoleFunction> roleFunctionList=systemService.findByProperty(TSRoleFunction.class, "TSRole.id", role.getId());
      Map<String,TSRoleFunction> map = new HashMap<String,TSRoleFunction>();
      for (TSRoleFunction functionOfRole : roleFunctionList){
        map.put(functionOfRole.getTSFunction().getId(),functionOfRole);
      }
      String[] roleFunctions = rolefunction.split(",");
View Full Code Here

Examples of org.jeecgframework.web.system.pojo.base.TSRole

            List role = new ArrayList();
            i=1;
            while(rs.next())
            {
              org.jeecgframework.core.util.LogUtil.info(rs.getString("rolename"));
                 TSRole tsRole = new TSRole();
                 tsRole.setId(i+"");
                 tsRole.setRoleName(rs.getString("rolename"));
                 tsRole.setRoleCode(rs.getString("rolecode"));
                 role.add(tsRole);
                 i++;
            }
            root.put("role", role);
           
View Full Code Here

Examples of org.jeecgframework.web.system.pojo.base.TSRole

  /**
   * @Description 修复用户角色表
   * @author tanghan 2013-7-23
   */
  private void repairUserRole() {
    TSRole admin = commonDao.findByProperty(TSRole.class, "roleCode",
        "admin").get(0);
    TSRole manager = commonDao.findByProperty(TSRole.class, "roleCode",
        "manager").get(0);
    List<TSUser> user = commonDao.loadAll(TSUser.class);
    for (int i = 0; i < user.size(); i++) {
      if (user.get(i).getEmail() != null) {
        TSRoleUser roleuser = new TSRoleUser();
View Full Code Here

Examples of org.jeecgframework.web.system.pojo.base.TSRole

  /**
   * @Description 修复角色权限表
   * @author tanghan 2013-7-23
   */
  private void repairRoleFunction() {
    TSRole admin = commonDao.findByProperty(TSRole.class, "roleCode",
        "admin").get(0);
    TSRole manager = commonDao.findByProperty(TSRole.class, "roleCode",
        "manager").get(0);
    List<TSFunction> list = commonDao.loadAll(TSFunction.class);
    for (int i = 0; i < list.size(); i++) {
      TSRoleFunction adminroleFunction = new TSRoleFunction();
      TSRoleFunction managerFunction = new TSRoleFunction();
View Full Code Here
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.