import org.apache.wicket.markup.html.list.ListItem;\r
import org.apache.wicket.markup.html.list.ListView;\r
import org.apache.wicket.markup.html.panel.Fragment;\r
-import org.apache.wicket.model.IModel;\r
import org.apache.wicket.model.Model;\r
+import org.apache.wicket.model.PropertyModel;\r
\r
import com.gitblit.Constants.AccessRestrictionType;\r
import com.gitblit.Constants.AuthorizationControl;\r
\r
private RadioGroup<AccessPolicy> policiesGroup;\r
\r
- private IModel<Boolean> allowForks;\r
-\r
public AccessPolicyPanel(String wicketId, RepositoryModel repository) {\r
this(wicketId, repository, null);\r
}\r
}\r
add(policiesGroup);\r
\r
- allowForks = Model.of(app().settings().getBoolean(Keys.web.allowForking, true));\r
- if (allowForks.getObject()) {\r
+ if (app().settings().getBoolean(Keys.web.allowForking, true)) {\r
Fragment fragment = new Fragment("allowForks", "allowForksFragment", this);\r
fragment.add(new BooleanOption("allowForks",\r
getString("gb.allowForks"),\r
getString("gb.allowForksDescription"),\r
- allowForks));\r
+ new PropertyModel<Boolean>(repository, "allowForks")));\r
add(fragment);\r
} else {\r
add(new Label("allowForks").setVisible(false));\r
AccessPolicy policy = policiesGroup.getModelObject();\r
repository.authorizationControl = policy.control;\r
repository.accessRestriction = policy.type;\r
- repository.allowForks = allowForks.getObject();\r
}\r
\r
@Override\r