| | |
| | | import com.gitblit.manager.IGitblit; |
| | | import com.gitblit.models.RepositoryModel; |
| | | import com.gitblit.models.UserModel; |
| | | import com.gitblit.transport.ssh.SshSession; |
| | | |
| | | /** |
| | | * Resolves repositories and grants export access. |
| | |
| | | // git request |
| | | GitDaemonClient client = (GitDaemonClient) req; |
| | | client.setRepositoryName(name); |
| | | } else if (req instanceof SshSession) { |
| | | SshSession s = (SshSession)req; |
| | | s.setRepositoryName(name); |
| | | } |
| | | return repo; |
| | | } |
| | |
| | | if (user == null) { |
| | | user = UserModel.ANONYMOUS; |
| | | } |
| | | } else if (req instanceof SshSession) { |
| | | SshSession s = (SshSession) req; |
| | | user = gitblit.authenticate(s); |
| | | if (user == null) { |
| | | throw new IOException(String.format("User %s not found", s.getRemoteUser())); |
| | | } |
| | | } |
| | | |
| | | if (user.canClone(model)) { |