Implemented default access restriction (issue-88)
| | |
| | | # SINCE 0.9.0
|
| | | git.onlyAccessBareRepositories = false
|
| | |
|
| | | # The default access restriction for new repositories.
|
| | | # Valid values are NONE, PUSH, CLONE, VIEW
|
| | | # NONE = anonymous view, clone, & push
|
| | | # PUSH = anonymous view & clone and authenticated push
|
| | | # CLONE = anonymous view, authenticated clone & push
|
| | | # VIEW = authenticated view, clone, & push
|
| | | #
|
| | | # SINCE 1.0.0
|
| | | git.defaultAccessRestriction = NONE
|
| | |
|
| | | #
|
| | | # Groovy Integration
|
| | | #
|
| | |
| | |
|
| | | #### additions
|
| | |
|
| | | - Added default access restriction. Applies to new repositories and repositories that have not been configured with Gitblit. (issue 88) |
| | | **New:** *git.defaultAccessRestriction = NONE* |
| | | - Added LDAP User Service with many new *realm.ldap* keys (Github/jcrygier)
|
| | | - Added support for custom repository properties for Groovy hooks (Github/jcrygier)
|
| | | - Added script to facilitate proxy environment setup on Linux (Github/mragab)
|
| | |
| | | model.useTickets = getConfig(config, "useTickets", false);
|
| | | model.useDocs = getConfig(config, "useDocs", false);
|
| | | model.accessRestriction = AccessRestrictionType.fromName(getConfig(config,
|
| | | "accessRestriction", null));
|
| | | "accessRestriction", settings.getString(Keys.git.defaultAccessRestriction, null)));
|
| | | model.showRemoteBranches = getConfig(config, "showRemoteBranches", false);
|
| | | model.isFrozen = getConfig(config, "isFrozen", false);
|
| | | model.showReadme = getConfig(config, "showReadme", false);
|
| | |
| | | JOptionPane.showMessageDialog(EditRepositoryDialog.this, message,
|
| | | Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);
|
| | | }
|
| | | |
| | | public void setAccessRestriction(AccessRestrictionType restriction) {
|
| | | this.accessRestriction.setSelectedItem(restriction);
|
| | | }
|
| | |
|
| | | public void setUsers(String owner, List<String> all, List<String> selected) {
|
| | | ownerField.setModel(new DefaultComboBoxModel(all.toArray()));
|
| | |
| | | import java.util.TreeSet;
|
| | |
|
| | | import com.gitblit.Constants;
|
| | | import com.gitblit.Constants.AccessRestrictionType;
|
| | | import com.gitblit.GitBlitException.ForbiddenException;
|
| | | import com.gitblit.GitBlitException.NotAllowedException;
|
| | | import com.gitblit.GitBlitException.UnauthorizedException;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public AccessRestrictionType getDefaultAccessRestriction() {
|
| | | String restriction = null;
|
| | | if (settings.hasKey(Keys.git.defaultAccessRestriction)) {
|
| | | restriction = settings.get(Keys.git.defaultAccessRestriction).currentValue;
|
| | | }
|
| | | return AccessRestrictionType.fromName(restriction);
|
| | | }
|
| | |
|
| | | /**
|
| | | * Returns the list of pre-receive scripts the repository inherited from the
|
| | | * global settings and team affiliations.
|
| | |
| | | protected void createRepository() {
|
| | | EditRepositoryDialog dialog = new EditRepositoryDialog(gitblit.getProtocolVersion());
|
| | | dialog.setLocationRelativeTo(RepositoriesPanel.this);
|
| | | dialog.setAccessRestriction(gitblit.getDefaultAccessRestriction());
|
| | | dialog.setUsers(null, gitblit.getUsernames(), null);
|
| | | dialog.setTeams(gitblit.getTeamnames(), null);
|
| | | dialog.setRepositories(gitblit.getRepositories());
|
| | |
| | | // create constructor
|
| | | super();
|
| | | isCreate = true;
|
| | | setupPage(new RepositoryModel());
|
| | | RepositoryModel model = new RepositoryModel();
|
| | | String restriction = GitBlit.getString(Keys.git.defaultAccessRestriction, null);
|
| | | model.accessRestriction = AccessRestrictionType.fromName(restriction);
|
| | | setupPage(model);
|
| | | }
|
| | |
|
| | | public EditRepositoryPage(PageParameters params) {
|