Package org.jeecgframework.web.system.pojo.base

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


  /**
   * @Description 修复角色表
   * @author tanghan 2013-7-20
   */
  private void repairRole() {
    TSRole admin = new TSRole();
    admin.setRoleName("管理员");
    admin.setRoleCode("admin");
    commonDao.saveOrUpdate(admin);

    TSRole manager = new TSRole();
    manager.setRoleName("普通用户");
    manager.setRoleCode("manager");
    commonDao.saveOrUpdate(manager);

  }
View Full Code Here


  // ----------------------------------------------------------------

 
  public Set<String> getOperationCodesByRoleIdAndFunctionId(String roleId, String functionId) {
    Set<String> operationCodes = new HashSet<String>();
    TSRole role = commonDao.get(TSRole.class, roleId);
    CriteriaQuery cq1 = new CriteriaQuery(TSRoleFunction.class);
    cq1.eq("TSRole.id", role.getId());
    cq1.eq("TSFunction.id", functionId);
    cq1.add();
    List<TSRoleFunction> rFunctions = getListByCriteriaQuery(cq1, false);
    if (null != rFunctions && rFunctions.size() > 0) {
      TSRoleFunction tsRoleFunction = rFunctions.get(0);
View Full Code Here

 
  public Set<String> getOperationCodesByUserIdAndFunctionId(String userId, String functionId) {
    Set<String> operationCodes = new HashSet<String>();
    List<TSRoleUser> rUsers = findByProperty(TSRoleUser.class, "TSUser.id", userId);
    for (TSRoleUser ru : rUsers) {
      TSRole role = ru.getTSRole();
      CriteriaQuery cq1 = new CriteriaQuery(TSRoleFunction.class);
      cq1.eq("TSRole.id", role.getId());
      cq1.eq("TSFunction.id", functionId);
      cq1.add();
      List<TSRoleFunction> rFunctions = getListByCriteriaQuery(cq1, false);
      if (null != rFunctions && rFunctions.size() > 0) {
        TSRoleFunction tsRoleFunction = rFunctions.get(0);
View Full Code Here

      // 刷新缓存
      HttpSession session = ContextHolderUtils.getSession();
      TSUser user = ResourceUtil.getSessionUserName();
      List<TSRoleUser> rUsers = this.findByProperty(TSRoleUser.class, "TSUser.id", user.getId());
      for (TSRoleUser ru : rUsers) {
        TSRole role = ru.getTSRole();
        session.removeAttribute(role.getId());
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.jeecgframework.web.system.pojo.base.TSRole

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.