BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
97e6c9b4
Commit
97e6c9b4
authored
Oct 02, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrong access level badge on MR comments
parent
c867c225
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
+20
-3
CHANGELOG
CHANGELOG
+1
-0
project_team.rb
app/models/project_team.rb
+4
-0
_note.html.haml
app/views/projects/notes/_note.html.haml
+3
-3
project_team_spec.rb
spec/models/project_team_spec.rb
+12
-0
No files found.
CHANGELOG
View file @
97e6c9b4
...
...
@@ -26,6 +26,7 @@ v 8.1.0 (unreleased)
- Show additions/deletions stats on merge request diff
- Remove footer text in emails (Zeger-Jan van de Weg)
- Ensure code blocks are properly highlighted after a note is updated
- Fix wrong access level badge on MR comments
v 8.0.3
- Fix URL shown in Slack notifications
...
...
app/models/project_team.rb
View file @
97e6c9b4
...
...
@@ -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
)
...
...
app/views/projects/notes/_note.html.haml
View file @
97e6c9b4
...
...
@@ -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
)
...
...
spec/models/project_team_spec.rb
View file @
97e6c9b4
...
...
@@ -66,4 +66,16 @@ describe ProjectTeam do
it
{
expect
(
project
.
team
.
member?
(
guest
)).
to
be_truthy
}
end
end
describe
"#human_max_access"
do
it
"return master role"
do
user
=
create
:user
group
=
create
:group
group
.
add_users
([
user
.
id
],
GroupMember
::
MASTER
)
project
=
create
(
:project
,
namespace:
group
)
project
.
team
<<
[
user
,
:guest
]
expect
(
project
.
team
.
human_max_access
(
user
.
id
)).
to
eq
(
"Master"
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment