Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-17 18:08:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-17 18:08:15 +0300
commitc2b98d3dbd47ab92c79c702276fe9130d9a28036 (patch)
treebf4071f551fdc12c22b23b2bb66483064e7b9ea9 /app/policies
parentbadb9c1deacbea601b02f88811b7e123589d9251 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/blob_policy.rb7
-rw-r--r--app/policies/wiki_page_policy.rb7
2 files changed, 14 insertions, 0 deletions
diff --git a/app/policies/blob_policy.rb b/app/policies/blob_policy.rb
new file mode 100644
index 00000000000..639b9dfeea7
--- /dev/null
+++ b/app/policies/blob_policy.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class BlobPolicy < BasePolicy
+ delegate { @subject.project }
+
+ rule { can?(:download_code) }.enable :read_blob
+end
diff --git a/app/policies/wiki_page_policy.rb b/app/policies/wiki_page_policy.rb
new file mode 100644
index 00000000000..468632c9085
--- /dev/null
+++ b/app/policies/wiki_page_policy.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class WikiPagePolicy < BasePolicy
+ delegate { @subject.wiki.project }
+
+ rule { can?(:read_wiki) }.enable :read_wiki_page
+end