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
7fa72910
Commit
7fa72910
authored
Feb 28, 2022
by
Serena Fang
Committed by
Douglas Barbosa Alexandre
Mar 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Users who can read group should read group token
Changelog: fixed
parent
86a01c36
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
app/graphql/types/user_interface.rb
app/graphql/types/user_interface.rb
+4
-0
lib/api/entities/user_safe.rb
lib/api/entities/user_safe.rb
+4
-0
No files found.
app/graphql/types/user_interface.rb
View file @
7fa72910
...
...
@@ -136,6 +136,10 @@ module Types
def
redacted_name
return
object
.
name
unless
object
.
project_bot?
if
object
.
groups
return
object
.
name
if
context
[
:current_user
]
&
.
can?
(
:read_group
,
object
.
groups
.
first
)
end
return
object
.
name
if
context
[
:current_user
]
&
.
can?
(
:read_project
,
object
.
projects
.
first
)
# If the requester does not have permission to read the project bot name,
...
...
lib/api/entities/user_safe.rb
View file @
7fa72910
...
...
@@ -11,6 +11,10 @@ module API
current_user
=
request
.
respond_to?
(
:current_user
)
?
request
.
current_user
:
options
.
fetch
(
:current_user
,
nil
)
if
user
.
groups
next
user
.
name
if
current_user
&
.
can?
(
:read_group
,
user
.
groups
.
first
)
end
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,
...
...
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