summaryrefslogtreecommitdiff
path: root/app/policies
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2017-11-23 15:47:15 +0100
committerTomasz Maczukin <tomasz@maczukin.pl>2017-11-23 17:44:05 +0100
commit97f966c445c0c2191a8017aa981a34737b9adf56 (patch)
tree297294c7ae4b22267da7c88aac70a13263346542 /app/policies
parentdfbfd3c7d7d4677ac99a7f8147a673911e8d4e98 (diff)
downloadgitlab-ce-97f966c445c0c2191a8017aa981a34737b9adf56.tar.gz
Introduce :read_namespace access policy for namespace and group
Diffstat (limited to 'app/policies')
-rw-r--r--app/policies/group_policy.rb2
-rw-r--r--app/policies/namespace_policy.rb1
2 files changed, 3 insertions, 0 deletions
diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb
index 8af9738d75c..a2518bc1080 100644
--- a/app/policies/group_policy.rb
+++ b/app/policies/group_policy.rb
@@ -34,6 +34,8 @@ class GroupPolicy < BasePolicy
rule { admin } .enable :read_group
rule { has_projects } .enable :read_group
+ rule { has_access }.enable :read_namespace
+
rule { developer }.enable :admin_milestones
rule { reporter }.enable :admin_label
diff --git a/app/policies/namespace_policy.rb b/app/policies/namespace_policy.rb
index 92213f0155e..eb01218eb0a 100644
--- a/app/policies/namespace_policy.rb
+++ b/app/policies/namespace_policy.rb
@@ -8,6 +8,7 @@ class NamespacePolicy < BasePolicy
rule { owner | admin }.policy do
enable :create_projects
enable :admin_namespace
+ enable :read_namespace
end
rule { personal_project & ~can_create_personal_project }.prevent :create_projects