Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
803ca4b8
Commit
803ca4b8
authored
Mar 07, 2022
by
Serena Fang
Committed by
Douglas Barbosa Alexandre
Mar 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply reviewer suggestions
parent
1edd7c71
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
4 deletions
+2
-4
app/graphql/types/user_interface.rb
app/graphql/types/user_interface.rb
+0
-2
app/models/concerns/has_user_type.rb
app/models/concerns/has_user_type.rb
+2
-0
lib/api/entities/user_safe.rb
lib/api/entities/user_safe.rb
+0
-2
No files found.
app/graphql/types/user_interface.rb
View file @
803ca4b8
...
...
@@ -134,8 +134,6 @@ module Types
end
def
redacted_name
return
object
.
name
unless
object
.
project_bot?
object
.
secure_name
(
context
[
:current_user
])
end
end
...
...
app/models/concerns/has_user_type.rb
View file @
803ca4b8
...
...
@@ -48,6 +48,8 @@ module HasUserType
end
def
secure_name
(
viewing_user
)
return
self
.
name
unless
self
.
project_bot?
if
self
.
groups
.
any?
return
self
.
name
if
viewing_user
&
.
can?
(
:read_group
,
self
.
groups
.
first
)
end
...
...
lib/api/entities/user_safe.rb
View file @
803ca4b8
...
...
@@ -5,8 +5,6 @@ module API
class
UserSafe
<
Grape
::
Entity
expose
:id
,
:username
expose
:name
do
|
user
|
next
user
.
name
unless
user
.
project_bot?
user
.
secure_name
(
options
[
:current_user
])
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