Package org.beangle.ems.security.restrict

Examples of org.beangle.ems.security.restrict.RestrictPattern


    put("pattern", getEntity(RestrictPattern.class, "pattern"));
    return forward();
  }

  public String editPattern() {
    RestrictPattern pattern = getEntity(RestrictPattern.class, "pattern");
    put("pattern", pattern);
    put("entities", entityDao.getAll(RestrictEntity.class));
    return forward("patternForm");
  }
View Full Code Here


    put("entities", entityDao.getAll(RestrictEntity.class));
    return forward("patternForm");
  }

  public String savePattern() {
    RestrictPattern pattern = populateEntity(RestrictPattern.class, "pattern");
    entityDao.saveOrUpdate(pattern);
    return redirect("patterns", "info.save.success");
  }
View Full Code Here

    StringBuilder conBuffer = new StringBuilder();
    List<Object> paramValues = CollectUtils.newArrayList();
    int index = 0;
    for (final Restriction restriction : restrictions) {
      // 处理限制对应的模式
      RestrictPattern pattern = restriction.getPattern();
      if (null == pattern || StringUtils.isEmpty(pattern.getContent())) {
        continue;
      }
      String patternContent = pattern.getContent();
      patternContent = StringUtils.replace(patternContent, "{alias}", query.getAlias());
      String[] contents = StringUtils.split(StringUtils.replace(patternContent, " and ", "$"), "$");

      StringBuilder singleConBuf = new StringBuilder("(");
      for (int i = 0; i < contents.length; i++) {
        String content = contents[i];
        Condition c = new Condition(content);
        List<String> params = c.getParamNames();
        for (final String paramName : params) {
          RestrictField param = pattern.getEntity().getField(paramName);
          String value = restriction.getItem(param);
          if (StringUtils.isNotEmpty(value)) {
            if (value.equals(Restriction.ALL)) {
              content = "";
            } else {
View Full Code Here

TOP

Related Classes of org.beangle.ems.security.restrict.RestrictPattern

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.