diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-11-30 20:55:37 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2016-11-30 20:55:37 +0000 |
commit | 24e5a1e8db943be346b4f7f4fb49326ad0e5eb9e (patch) | |
tree | f0c82b4d402f47c70ab4e5a5125b9465c22327c3 /app | |
parent | 37655a853e7e8c6ee33aeb42f8207e1522ad8326 (diff) | |
parent | 28688b5456f40cd45bfbc78e20e9d1d975e4aa60 (diff) | |
download | gitlab-ce-24e5a1e8db943be346b4f7f4fb49326ad0e5eb9e.tar.gz |
Merge branch 'fix/git-access-wiki-when-repository-feature-disabled' into 'master'
Fixes access to the wiki code with git when repository feature disabled
## What does this MR do?
Allow access to the wiki repository with git when the repository feature is disabled.
## Why was this MR needed?
Without this fix, if you create a wiki only project you are not allowed to download the wiki code from this project.
## Does this MR meet the acceptance criteria?
- [X] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- [ ] ~~API support added~~
- Tests
- [X] Added for this feature/bug
- [ ] All builds are passing
- [X] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [X] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [X] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
Fixes #24931
See merge request !7832
Diffstat (limited to 'app')
-rw-r--r-- | app/policies/project_policy.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index 1ee31023e26..8ac4bd9df6d 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -50,6 +50,7 @@ class ProjectPolicy < BasePolicy def reporter_access! can! :download_code + can! :download_wiki_code can! :fork_project can! :create_project_snippet can! :update_issue @@ -187,6 +188,7 @@ class ProjectPolicy < BasePolicy unless project.feature_available?(:wiki, user) || project.has_external_wiki? cannot!(*named_abilities(:wiki)) + cannot!(:download_wiki_code) end unless project.feature_available?(:builds, user) && repository_enabled @@ -226,6 +228,7 @@ class ProjectPolicy < BasePolicy can! :read_commit_status can! :read_container_image can! :download_code + can! :download_wiki_code can! :read_cycle_analytics # NOTE: may be overridden by IssuePolicy |