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
8b379465
Commit
8b379465
authored
Nov 21, 2016
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reenables /user API request to return private-token if user is admin and requested with sudo
parent
e09c6df0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
lib/api/entities.rb
lib/api/entities.rb
+1
-0
lib/api/users.rb
lib/api/users.rb
+1
-1
No files found.
lib/api/entities.rb
View file @
8b379465
...
...
@@ -32,6 +32,7 @@ module API
expose
:can_create_project?
,
as: :can_create_project
expose
:two_factor_enabled?
,
as: :two_factor_enabled
expose
:external
expose
:private_token
,
if:
lambda
{
|
user
,
options
|
user
.
is_admin?
&&
options
[
:sudo_identifier
]
}
end
class
UserLogin
<
UserFull
...
...
lib/api/users.rb
View file @
8b379465
...
...
@@ -353,7 +353,7 @@ module API
success
Entities
::
UserFull
end
get
do
present
current_user
,
with:
Entities
::
UserFull
present
current_user
,
with:
Entities
::
UserFull
,
sudo_identifier:
sudo_identifier
end
desc
"Get the currently authenticated user's SSH keys"
do
...
...
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