Пример #1
0
  ConstantPermissionMappingEditor(
      final Dispatcher circuit,
      ResourceDescription resourceDescription,
      SecurityContext securityContext) {
    this.circuit = circuit;
    this.securityContext = securityContext;
    selectionModel = new SingleSelectionModel<>();

    this.resourceDescription = new ResourceDescription(resourceDescription.clone());
    ModelNode reqPropsDescription =
        this.resourceDescription.get("operations").get("add").get("request-properties");
    ModelNode filtersDescription = reqPropsDescription.get("permissions").get("value-type");
    reqPropsDescription.set(filtersDescription);
  }
  AuthenticationContextMatchRulesEditor(
      final Dispatcher circuit,
      ResourceDescription resourceDescription,
      SecurityContext securityContext) {
    this.circuit = circuit;
    this.securityContext = securityContext;
    selectionModel = new SingleSelectionModel<>();

    // tweak to use ModelNodeFormBuilder automatic form generation
    this.resourceDescription = new ResourceDescription(resourceDescription.clone());
    // adds the match-rules to the request-properties of add operation
    ModelNode reqPropsDescription =
        this.resourceDescription.get("operations").get("add").get("request-properties");
    // adds the mechanism-configuration to the attribute list
    ModelNode attrPropsDescription = this.resourceDescription.get("attributes");
    ModelNode matchRulesDescription = reqPropsDescription.get(MATCH_RULES).get("value-type");
    reqPropsDescription.set(matchRulesDescription);
    attrPropsDescription.set(matchRulesDescription);
  }