diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-07-06 07:51:31 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-07-06 07:51:31 +0000 |
commit | 837c3b3d7322c56aa7baeec9b8fb617afe5b5e5c (patch) | |
tree | b6da7ba13c76c13e3afee03c11b7524f896f207f /app/helpers | |
parent | 83f79ced3fd98031194e5667c4d80f66d7987c67 (diff) | |
download | gitlab-ce-837c3b3d7322c56aa7baeec9b8fb617afe5b5e5c.tar.gz |
Fix User role displayed on projects dashboard
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/projects_helper.rb | 1 | ||||
-rw-r--r-- | app/helpers/users_helper.rb | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index c7a434ea092..b0f381db5ab 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -177,6 +177,7 @@ module ProjectsHelper controller.action_name, Gitlab::CurrentSettings.cache_key, "cross-project:#{can?(current_user, :read_cross_project)}", + max_project_member_access_cache_key(project), 'v2.6' ] diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index ce9373f5883..4d17b22a4a1 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -31,6 +31,14 @@ module UsersHelper current_user_menu_items.include?(item) end + def max_project_member_access(project) + current_user&.max_member_access_for_project(project.id) || Gitlab::Access::NO_ACCESS + end + + def max_project_member_access_cache_key(project) + "access:#{max_project_member_access(project)}" + end + private def get_profile_tabs |