James Moger
2013-09-27 b325021c4e3168ef77bf3eb28be1d4c834595de8
Change default access restriction to PUSH

Change-Id: I74b3f9fedd77294c53648f8eaa730d4a84917555
7 files modified
21 ■■■■ changed files
releases.moxie 5 ●●●●● patch | view | raw | blame | history
src/main/distrib/data/gitblit.properties 4 ●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/GitBlit.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/gitblit/GitFilter.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/gitblit/client/GitblitClient.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/gitblit/git/GitblitReceivePackFactory.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java 4 ●●●● patch | view | raw | blame | history
releases.moxie
@@ -5,7 +5,7 @@
    title: ${project.name} ${project.version} released
    id: ${project.version}
    date: ${project.buildDate}
    note: ~
    note: "The default access restriction has been elevated from NONE to PUSH and anonymous push access has been disabled."
    html: ~
    text: ~
    security: ~
@@ -27,7 +27,8 @@
    dependencyChanges: ~
    settings:
    - { name: 'git.createRepositoriesShared', defaultValue: 'false' }
    - { name: 'git.allowAnonymousPushes', defaultValue: 'true' }
    - { name: 'git.allowAnonymousPushes', defaultValue: 'false' }
    - { name: 'git.defaultAccessRestriction', defaultValue: 'PUSH' }
    - { name: 'web.commitMessageRenderer', defaultValue: 'plain' }
    - { name: 'web.showBranchGraph', defaultValue: 'true' }
    contributors:
src/main/distrib/data/gitblit.properties
@@ -155,7 +155,7 @@
# information.
#
# SINCE 1.4.0
git.allowAnonymousPushes = true
git.allowAnonymousPushes = false
# The default access restriction for new repositories.
# Valid values are NONE, PUSH, CLONE, VIEW
@@ -165,7 +165,7 @@
#  VIEW = authenticated view, clone, & push
#
# SINCE 1.0.0
git.defaultAccessRestriction = NONE
git.defaultAccessRestriction = PUSH
# The default authorization control for new repositories.
# Valid values are AUTHENTICATED and NAMED
src/main/java/com/gitblit/GitBlit.java
@@ -2008,7 +2008,7 @@
            model.incrementalPushTagPrefix = getConfig(config, "incrementalPushTagPrefix", null);
            model.allowForks = getConfig(config, "allowForks", true);
            model.accessRestriction = AccessRestrictionType.fromName(getConfig(config,
                    "accessRestriction", settings.getString(Keys.git.defaultAccessRestriction, null)));
                    "accessRestriction", settings.getString(Keys.git.defaultAccessRestriction, "PUSH")));
            model.authorizationControl = AuthorizationControl.fromName(getConfig(config,
                    "authorizationControl", settings.getString(Keys.git.defaultAuthorizationControl, null)));
            model.verifyCommitter = getConfig(config, "verifyCommitter", false);
src/main/java/com/gitblit/GitFilter.java
@@ -224,7 +224,7 @@
                } else {
                    // common repository, user default server settings
                    model.authorizationControl = AuthorizationControl.fromName(GitBlit.getString(Keys.git.defaultAuthorizationControl, ""));
                    model.accessRestriction = AccessRestrictionType.fromName(GitBlit.getString(Keys.git.defaultAccessRestriction, ""));
                    model.accessRestriction = AccessRestrictionType.fromName(GitBlit.getString(Keys.git.defaultAccessRestriction, "PUSH"));
                }
                // create the repository
src/main/java/com/gitblit/client/GitblitClient.java
@@ -193,7 +193,7 @@
    }
    
    public AccessRestrictionType getDefaultAccessRestriction() {
        String restriction = null;
        String restriction = "PUSH";
        if (settings.hasKey(Keys.git.defaultAccessRestriction)) {
            restriction = settings.get(Keys.git.defaultAccessRestriction).currentValue;
        }
src/main/java/com/gitblit/git/GitblitReceivePackFactory.java
@@ -81,7 +81,7 @@
            timeout = client.getDaemon().getTimeout();
        }
        boolean allowAnonymousPushes = GitBlit.getBoolean(Keys.git.allowAnonymousPushes, true);
        boolean allowAnonymousPushes = GitBlit.getBoolean(Keys.git.allowAnonymousPushes, false);
        if (!allowAnonymousPushes && UserModel.ANONYMOUS.equals(user)) {
            // prohibit anonymous pushes
            throw new ServiceNotEnabledException();
src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java
@@ -86,7 +86,7 @@
        super();
        isCreate = true;
        RepositoryModel model = new RepositoryModel();
        String restriction = GitBlit.getString(Keys.git.defaultAccessRestriction, null);
        String restriction = GitBlit.getString(Keys.git.defaultAccessRestriction, "PUSH");
        model.accessRestriction = AccessRestrictionType.fromName(restriction);
        String authorization = GitBlit.getString(Keys.git.defaultAuthorizationControl, null);
        model.authorizationControl = AuthorizationControl.fromName(authorization);
@@ -418,7 +418,7 @@
        form.add(ownersPalette);
        form.add(new CheckBox("allowForks").setEnabled(GitBlit.getBoolean(Keys.web.allowForking, true)));
        DropDownChoice<AccessRestrictionType> accessRestriction = new DropDownChoice<AccessRestrictionType>("accessRestriction",
                AccessRestrictionType.choices(GitBlit.getBoolean(Keys.git.allowAnonymousPushes, true)), new AccessRestrictionRenderer());
                AccessRestrictionType.choices(GitBlit.getBoolean(Keys.git.allowAnonymousPushes, false)), new AccessRestrictionRenderer());
        form.add(accessRestriction);
        form.add(new CheckBox("isFrozen"));
        // TODO enable origin definition