James Moger
2014-11-04 4e84166db5c5538e3984d9d2d6bb1f9902e65ee0
src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java
@@ -25,6 +25,8 @@
import org.apache.wicket.markup.html.form.RadioGroup;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import com.gitblit.Constants.AccessRestrictionType;
@@ -48,6 +50,8 @@
   private final AjaxFormChoiceComponentUpdatingBehavior callback;
   private RadioGroup<AccessPolicy> policiesGroup;
   private IModel<Boolean> allowForks;
   public AccessPolicyPanel(String wicketId, RepositoryModel repository) {
      this(wicketId, repository, null);
@@ -142,6 +146,18 @@
      }
      add(policiesGroup);
      allowForks = Model.of(app().settings().getBoolean(Keys.web.allowForking, true));
      if (allowForks.getObject()) {
         Fragment fragment = new Fragment("allowForks", "allowForksFragment", this);
         fragment.add(new BooleanOption("allowForks",
            getString("gb.allowForks"),
            getString("gb.allowForksDescription"),
            allowForks));
         add(fragment);
      } else {
         add(new Label("allowForks").setVisible(false));
      }
      setOutputMarkupId(true);
   }
@@ -149,6 +165,7 @@
      AccessPolicy policy = policiesGroup.getModelObject();
      repository.authorizationControl = policy.control;
      repository.accessRestriction = policy.type;
      repository.allowForks = allowForks.getObject();
   }
   @Override