| | |
| | | import com.gitblit.transport.ssh.IPublicKeyManager; |
| | | import com.gitblit.transport.ssh.SshKey; |
| | | import com.gitblit.utils.ArrayUtils; |
| | | import com.gitblit.utils.HttpUtils; |
| | | import com.gitblit.utils.JsonUtils; |
| | | import com.gitblit.utils.ObjectCache; |
| | | import com.gitblit.utils.StringUtils; |
| | | import com.gitblit.utils.XssFilter; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.JsonIOException; |
| | | import com.google.gson.JsonSyntaxException; |
| | |
| | | RepositoryModel cloneModel = repository.cloneAs(cloneName); |
| | | // owner has REWIND/RW+ permissions |
| | | cloneModel.addOwner(user.username); |
| | | |
| | | // ensure initial access restriction of the fork |
| | | // is not lower than the source repository (issue-495/ticket-167) |
| | | if (repository.accessRestriction.exceeds(cloneModel.accessRestriction)) { |
| | | cloneModel.accessRestriction = repository.accessRestriction; |
| | | } |
| | | |
| | | repositoryManager.updateRepositoryModel(cloneName, cloneModel, false); |
| | | |
| | | // add the owner of the source repository to the clone's access list |
| | |
| | | return runtimeManager.getInjector(); |
| | | } |
| | | |
| | | @Override |
| | | public XssFilter getXssFilter() { |
| | | return runtimeManager.getXssFilter(); |
| | | } |
| | | |
| | | /* |
| | | * NOTIFICATION MANAGER |
| | | */ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<RepositoryModel> getRepositoryModels() { |
| | | return repositoryManager.getRepositoryModels(); |
| | | } |
| | | |
| | | @Override |
| | | public List<RepositoryModel> getRepositoryModels(UserModel user) { |
| | | return repositoryManager.getRepositoryModels(user); |
| | | } |