summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorDaniel Gerhardt <code@dgerhardt.net>2015-07-19 20:58:59 +0200
committerDaniel Gerhardt <code@dgerhardt.net>2015-07-19 21:33:21 +0200
commit69417d36b2fa4dfbe2205c4df1428eb17ebd061e (patch)
tree4cbfd405bf327a2ba235ea3dfdf9909ef93cba54 /app/helpers
parente8aaf5680355b2a71ab85439f653a70f4b487e0b (diff)
downloadgitlab-ce-69417d36b2fa4dfbe2205c4df1428eb17ebd061e.tar.gz
Fix label read access for unauthenticated users
The label page was added to navigation for unauthorized users because the previously used milestone read permission was still checked. This has been fixed and read access to labels is now granted (again) for public projects. This regression has been introduced in 07efb17e10fe26a01b60d8441868f9fbda0768f2 (7.12). See also 9bcd36396b9b71467f66dd4ed79ab709bb5d027a. Refs !836, !842.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/projects_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index f61baf00525..3cd52b381bd 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -131,8 +131,12 @@ module ProjectsHelper
nav_tabs << :snippets
end
+ if can?(current_user, :read_label, project)
+ nav_tabs << :labels
+ end
+
if can?(current_user, :read_milestone, project)
- nav_tabs << [:milestones, :labels]
+ nav_tabs << :milestones
end
nav_tabs.flatten