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
86a01c36
Commit
86a01c36
authored
Feb 23, 2022
by
Serena Fang
Committed by
Douglas Barbosa Alexandre
Mar 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bot token name in issues
Changelog: fixed
parent
35f1dd93
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
app/serializers/member_entity.rb
app/serializers/member_entity.rb
+1
-3
app/serializers/request_aware_entity.rb
app/serializers/request_aware_entity.rb
+1
-1
lib/api/entities/user_safe.rb
lib/api/entities/user_safe.rb
+5
-1
No files found.
app/serializers/member_entity.rb
View file @
86a01c36
...
...
@@ -40,9 +40,7 @@ class MemberEntity < Grape::Entity
expose
:valid_level_roles
,
as: :valid_roles
expose
:user
,
if:
->
(
member
)
{
member
.
user
.
present?
}
do
|
member
,
options
|
MemberUserEntity
.
represent
(
member
.
user
,
options
)
end
expose
:user
,
if:
->
(
member
)
{
member
.
user
.
present?
},
using:
MemberUserEntity
expose
:state
...
...
app/serializers/request_aware_entity.rb
View file @
86a01c36
...
...
@@ -10,6 +10,6 @@ module RequestAwareEntity
end
def
request
options
.
fetch
(
:request
)
options
.
fetch
(
:request
,
nil
)
end
end
lib/api/entities/user_safe.rb
View file @
86a01c36
...
...
@@ -3,11 +3,15 @@
module
API
module
Entities
class
UserSafe
<
Grape
::
Entity
include
RequestAwareEntity
expose
:id
,
:username
expose
:name
do
|
user
|
next
user
.
name
unless
user
.
project_bot?
next
user
.
name
if
options
[
:current_user
]
&
.
can?
(
:read_project
,
user
.
projects
.
first
)
current_user
=
request
.
respond_to?
(
:current_user
)
?
request
.
current_user
:
options
.
fetch
(
:current_user
,
nil
)
next
user
.
name
if
current_user
&
.
can?
(
:read_project
,
user
.
projects
.
first
)
# If the requester does not have permission to read the project bot name,
# the API returns an arbitrary string. UI changes will be addressed in a follow up issue:
...
...
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