diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-10-02 17:39:58 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-10-02 17:39:58 +0300 |
commit | 0e7b96bf4854f5113bd208ee400e68d9fba09ad8 (patch) | |
tree | 503859aa42501ca05c50cfffbe7801a7bbfbecc3 /app | |
parent | 93522e59eccd8fd5801f313b34fec6a4f6394d9a (diff) | |
parent | 97e6c9b42ca65be14f64f1528821922b2b0bd04a (diff) |
Merge branch 'access_level_badge_bug' into 'master'
Fix: Wrong access level badge on MR comments
https://gitlab.com/gitlab-org/gitlab-ce/issues/2654
See merge request !1501
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project_team.rb | 4 | ||||
-rw-r--r-- | app/views/projects/notes/_note.html.haml | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/app/models/project_team.rb b/app/models/project_team.rb index 56e49af2324..f602a965364 100644 --- a/app/models/project_team.rb +++ b/app/models/project_team.rb @@ -135,6 +135,10 @@ class ProjectTeam !!find_member(user_id) end + def human_max_access(user_id) + Gitlab::Access.options.key max_member_access(user_id) + end + def max_member_access(user_id) access = [] access << project.project_members.find_by(user_id: user_id).try(:access_field) diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml index cf5d5d6d8ba..1638ad6891a 100644 --- a/app/views/projects/notes/_note.html.haml +++ b/app/views/projects/notes/_note.html.haml @@ -14,10 +14,10 @@ = icon('trash-o') - unless note.system - - member = note.project.team.find_member(note.author.id) - - if member + - access = note.project.team.human_max_access(note.author.id) + - if access %span.note-role.label - = member.human_access + = access = link_to_member(note.project, note.author, avatar: false) |