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
bd132dfe
Commit
bd132dfe
authored
Feb 05, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make find_user_from_sources extensible for EE
parent
cf887a8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
lib/api/api_guard.rb
lib/api/api_guard.rb
+5
-1
No files found.
lib/api/api_guard.rb
View file @
bd132dfe
...
@@ -42,7 +42,7 @@ module API
...
@@ -42,7 +42,7 @@ module API
include
Gitlab
::
Auth
::
UserAuthFinders
include
Gitlab
::
Auth
::
UserAuthFinders
def
find_current_user!
def
find_current_user!
user
=
find_user_from_
access_token
||
find_user_from_warden
user
=
find_user_from_
sources
return
unless
user
return
unless
user
forbidden!
(
'User is blocked'
)
unless
Gitlab
::
UserAccess
.
new
(
user
).
allowed?
&&
user
.
can?
(
:access_api
)
forbidden!
(
'User is blocked'
)
unless
Gitlab
::
UserAccess
.
new
(
user
).
allowed?
&&
user
.
can?
(
:access_api
)
...
@@ -50,6 +50,10 @@ module API
...
@@ -50,6 +50,10 @@ module API
user
user
end
end
def
find_user_from_sources
find_user_from_access_token
||
find_user_from_warden
end
private
private
# An array of scopes that were registered (using `allow_access_with_scope`)
# An array of scopes that were registered (using `allow_access_with_scope`)
...
...
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