]> source.dussan.org Git - gitblit.git/commitdiff
Enable verify committer iff >= push restricted
authorJames Moger <james.moger@gitblit.com>
Wed, 31 Oct 2012 12:49:37 +0000 (08:49 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 31 Oct 2012 12:49:37 +0000 (08:49 -0400)
src/com/gitblit/client/EditRepositoryDialog.java
src/com/gitblit/wicket/pages/EditRepositoryPage.java

index b4b662942fd05441624401e68bbbe798a0a721a4..a9274964aaf29bcc25843e7b32d47deadc692138 100644 (file)
@@ -250,7 +250,7 @@ public class EditRepositoryDialog extends JDialog {
                allowAuthenticated.addItemListener(new ItemListener() {\r
                        @Override\r
                        public void itemStateChanged(ItemEvent e) {\r
-                               if (e.getStateChange() == ItemEvent.SELECTED) {\r
+                               if (e.getStateChange() == ItemEvent.SELECTED) {                                 \r
                                        usersPalette.setEnabled(false);\r
                                        teamsPalette.setEnabled(false);\r
                                }\r
@@ -462,9 +462,11 @@ public class EditRepositoryDialog extends JDialog {
                        \r
                        allowAuthenticated.setEnabled(false);\r
                        allowNamed.setEnabled(false);\r
+                       verifyCommitter.setEnabled(false);\r
                } else {\r
                        allowAuthenticated.setEnabled(true);\r
                        allowNamed.setEnabled(true);\r
+                       verifyCommitter.setEnabled(true);\r
                        \r
                        if (allowNamed.isSelected()) {\r
                                usersPalette.setEnabled(true);\r
index cc0db68028580c0040afd52183be8387fa902acd..60076177c82d36bb8d17c271412e3809877dcb33 100644 (file)
@@ -146,11 +146,10 @@ public class EditRepositoryPage extends RootSubPage {
                        }\r
                } else {\r
                        super.setupPage(getString("gb.edit"), repositoryModel.name);\r
-                       if (repositoryModel.accessRestriction.exceeds(AccessRestrictionType.NONE)) {\r
-                               repositoryUsers.addAll(GitBlit.self().getUserAccessPermissions(repositoryModel));\r
-                               repositoryTeams.addAll(GitBlit.self().getTeamAccessPermissions(repositoryModel));\r
-                               Collections.sort(repositoryUsers);\r
-                       }\r
+                       repositoryUsers.addAll(GitBlit.self().getUserAccessPermissions(repositoryModel));\r
+                       repositoryTeams.addAll(GitBlit.self().getTeamAccessPermissions(repositoryModel));\r
+                       Collections.sort(repositoryUsers);\r
+                       \r
                        federationSets.addAll(repositoryModel.federationSets);\r
                        if (!ArrayUtils.isEmpty(repositoryModel.indexedBranches)) {\r
                                indexedBranches.addAll(repositoryModel.indexedBranches);\r
@@ -423,8 +422,10 @@ public class EditRepositoryPage extends RootSubPage {
                final RadioChoice<AuthorizationControl> authorizationControl = new RadioChoice<Constants.AuthorizationControl>(\r
                                "authorizationControl", acList, new AuthorizationControlRenderer());\r
                form.add(authorizationControl);\r
-                               \r
-               form.add(new CheckBox("verifyCommitter"));\r
+               \r
+               final CheckBox verifyCommitter = new CheckBox("verifyCommitter");\r
+               verifyCommitter.setOutputMarkupId(true);\r
+               form.add(verifyCommitter);\r
 \r
                form.add(usersPalette);\r
                form.add(teamsPalette);\r
@@ -446,14 +447,16 @@ public class EditRepositoryPage extends RootSubPage {
                        usersPalette.setEnabled(false);\r
                        teamsPalette.setEnabled(false);\r
                        authorizationControl.setEnabled(false);\r
+                       verifyCommitter.setEnabled(false);\r
                } else {\r
                        // authenticated something\r
                        // enable authorization controls\r
                        authorizationControl.setEnabled(true);\r
+                       verifyCommitter.setEnabled(true);\r
                        \r
                        boolean allowFineGrainedControls = repositoryModel.authorizationControl.equals(AuthorizationControl.NAMED);\r
                        usersPalette.setEnabled(allowFineGrainedControls);\r
-                       teamsPalette.setEnabled(allowFineGrainedControls);                      \r
+                       teamsPalette.setEnabled(allowFineGrainedControls);\r
                }\r
                \r
                accessRestriction.add(new AjaxFormComponentUpdatingBehavior("onchange") {\r
@@ -464,6 +467,7 @@ public class EditRepositoryPage extends RootSubPage {
                                // enable/disable permissions panel based on access restriction\r
                                boolean allowAuthorizationControl = repositoryModel.accessRestriction.exceeds(AccessRestrictionType.NONE);\r
                                authorizationControl.setEnabled(allowAuthorizationControl);\r
+                               verifyCommitter.setEnabled(allowAuthorizationControl);\r
                                \r
                                boolean allowFineGrainedControls = allowAuthorizationControl && repositoryModel.authorizationControl.equals(AuthorizationControl.NAMED);\r
                                usersPalette.setEnabled(allowFineGrainedControls);\r
@@ -474,6 +478,7 @@ public class EditRepositoryPage extends RootSubPage {
                                }\r
                                \r
                                target.addComponent(authorizationControl);\r
+                               target.addComponent(verifyCommitter);\r
                                target.addComponent(usersPalette);\r
                                target.addComponent(teamsPalette);\r
                        }\r