From: James Moger Date: Wed, 31 Oct 2012 12:49:37 +0000 (-0400) Subject: Enable verify committer iff >= push restricted X-Git-Tag: v1.2.0~119 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=70e3d195c738cd190c46754d2d1b0c2eed9a4d4b;p=gitblit.git Enable verify committer iff >= push restricted --- diff --git a/src/com/gitblit/client/EditRepositoryDialog.java b/src/com/gitblit/client/EditRepositoryDialog.java index b4b66294..a9274964 100644 --- a/src/com/gitblit/client/EditRepositoryDialog.java +++ b/src/com/gitblit/client/EditRepositoryDialog.java @@ -250,7 +250,7 @@ public class EditRepositoryDialog extends JDialog { allowAuthenticated.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { - if (e.getStateChange() == ItemEvent.SELECTED) { + if (e.getStateChange() == ItemEvent.SELECTED) { usersPalette.setEnabled(false); teamsPalette.setEnabled(false); } @@ -462,9 +462,11 @@ public class EditRepositoryDialog extends JDialog { allowAuthenticated.setEnabled(false); allowNamed.setEnabled(false); + verifyCommitter.setEnabled(false); } else { allowAuthenticated.setEnabled(true); allowNamed.setEnabled(true); + verifyCommitter.setEnabled(true); if (allowNamed.isSelected()) { usersPalette.setEnabled(true); diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/com/gitblit/wicket/pages/EditRepositoryPage.java index cc0db680..60076177 100644 --- a/src/com/gitblit/wicket/pages/EditRepositoryPage.java +++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.java @@ -146,11 +146,10 @@ public class EditRepositoryPage extends RootSubPage { } } else { super.setupPage(getString("gb.edit"), repositoryModel.name); - if (repositoryModel.accessRestriction.exceeds(AccessRestrictionType.NONE)) { - repositoryUsers.addAll(GitBlit.self().getUserAccessPermissions(repositoryModel)); - repositoryTeams.addAll(GitBlit.self().getTeamAccessPermissions(repositoryModel)); - Collections.sort(repositoryUsers); - } + repositoryUsers.addAll(GitBlit.self().getUserAccessPermissions(repositoryModel)); + repositoryTeams.addAll(GitBlit.self().getTeamAccessPermissions(repositoryModel)); + Collections.sort(repositoryUsers); + federationSets.addAll(repositoryModel.federationSets); if (!ArrayUtils.isEmpty(repositoryModel.indexedBranches)) { indexedBranches.addAll(repositoryModel.indexedBranches); @@ -423,8 +422,10 @@ public class EditRepositoryPage extends RootSubPage { final RadioChoice authorizationControl = new RadioChoice( "authorizationControl", acList, new AuthorizationControlRenderer()); form.add(authorizationControl); - - form.add(new CheckBox("verifyCommitter")); + + final CheckBox verifyCommitter = new CheckBox("verifyCommitter"); + verifyCommitter.setOutputMarkupId(true); + form.add(verifyCommitter); form.add(usersPalette); form.add(teamsPalette); @@ -446,14 +447,16 @@ public class EditRepositoryPage extends RootSubPage { usersPalette.setEnabled(false); teamsPalette.setEnabled(false); authorizationControl.setEnabled(false); + verifyCommitter.setEnabled(false); } else { // authenticated something // enable authorization controls authorizationControl.setEnabled(true); + verifyCommitter.setEnabled(true); boolean allowFineGrainedControls = repositoryModel.authorizationControl.equals(AuthorizationControl.NAMED); usersPalette.setEnabled(allowFineGrainedControls); - teamsPalette.setEnabled(allowFineGrainedControls); + teamsPalette.setEnabled(allowFineGrainedControls); } accessRestriction.add(new AjaxFormComponentUpdatingBehavior("onchange") { @@ -464,6 +467,7 @@ public class EditRepositoryPage extends RootSubPage { // enable/disable permissions panel based on access restriction boolean allowAuthorizationControl = repositoryModel.accessRestriction.exceeds(AccessRestrictionType.NONE); authorizationControl.setEnabled(allowAuthorizationControl); + verifyCommitter.setEnabled(allowAuthorizationControl); boolean allowFineGrainedControls = allowAuthorizationControl && repositoryModel.authorizationControl.equals(AuthorizationControl.NAMED); usersPalette.setEnabled(allowFineGrainedControls); @@ -474,6 +478,7 @@ public class EditRepositoryPage extends RootSubPage { } target.addComponent(authorizationControl); + target.addComponent(verifyCommitter); target.addComponent(usersPalette); target.addComponent(teamsPalette); }