summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2016-11-30 20:55:37 +0000
committerAlejandro Rodríguez <alejorro70@gmail.com>2016-12-01 12:16:42 -0300
commit56b33c11ee9b2cfb1e965b508cadf6d0bdfd0cac (patch)
tree619a06d9bbf13e4716b76853cdc885078de08f1b /app
parent93ee6811c0e01bffa8d59ea4647bed8ca8bab5e2 (diff)
downloadgitlab-ce-56b33c11ee9b2cfb1e965b508cadf6d0bdfd0cac.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.rb3
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