private RESTOutputRule createOutputRule(String base) {
    RESTOutputRule ret = new RESTOutputRule();

    ret.setPriority(rulePri++);
    ret.setUser(new IdName((long) (Math.random() * 10000), "user_" + base));
    ret.setGroup(new IdName((long) (Math.random() * 10000), "grp_" + base));
    ret.setInstance(new IdName((long) (Math.random() * 10000), "gs_" + base));
    ret.setService("WMS_" + base);
    ret.setRequest("getMap_" + base);
    ret.setWorkspace("wsp_" + base);
    ret.setLayer("layer_" + base);

    ret.setGrant(GrantType.ALLOW);

    //        RESTLayerConstraints constraints = new RESTLayerConstraints();
    //        constraints.setType(LayerType.VECTOR);
    //        constraints.setAllowedStyles(new
    // HashSet(Arrays.asList("teststyle1","teststyle2","Style_"+base)));
    //        constraints.setCqlFilterRead("CQL_READ");
    //        constraints.setCqlFilterWrite("CQL_WRITE");
    //        constraints.setDefaultStyle("Style_"+base);
    //        constraints.setRestrictedAreaWkt("wkt_"+base);
    //
    //        Set<LayerAttribute> attrs = new HashSet<LayerAttribute>();
    //        attrs.add(new LayerAttribute("attr1", "java.lang.String", AccessType.NONE));
    //        attrs.add(new LayerAttribute("attr2", "java.lang.String", AccessType.READONLY));
    //        attrs.add(new LayerAttribute("attr3", "java.lang.String", AccessType.READWRITE));
    //        constraints.setAttributes(attrs);
    //
    //        ret.setConstraints(constraints);

    return ret;
  }