summaryrefslogtreecommitdiff
path: root/app/models/ability.rb
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-07-15 18:46:29 -0300
committerRémy Coutable <remy@rymai.me>2016-07-20 14:38:21 +0200
commit4d69cb9d9460f9805bfc1f34ca3a600f54804167 (patch)
treed252ca69044d640cdc4d5253a00552ec5e90d5cc /app/models/ability.rb
parenta920bf3834e870dbc1afabb043c962d26a9c9664 (diff)
downloadgitlab-ce-4d69cb9d9460f9805bfc1f34ca3a600f54804167.tar.gz
Allow to disable user request access to groups/projects
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r--app/models/ability.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 6fd18f2ee24..e6c186c6910 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -172,7 +172,7 @@ class Ability
rules << :read_build if project.public_builds?
unless owner || project.team.member?(user) || project_group_member?(project, user)
- rules << :request_access
+ rules << :request_access if project.request_access_enabled
end
end
@@ -372,7 +372,7 @@ class Ability
]
end
- if group.public? || (group.internal? && !user.external?)
+ if (group.public? || (group.internal? && !user.external?)) && group.request_access_enabled
rules << :request_access unless group.users.include?(user)
end