Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
Commits
0b2c77f0
Commit
0b2c77f0
authored
Oct 25, 2016
by
Kazuhiko Shiozaki
Committed by
Vincent Pelletier
Oct 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Security: simplify ERP5BearerExtractionPlugin.
parent
19a57e3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
product/ERP5Security/ERP5BearerExtractionPlugin.py
product/ERP5Security/ERP5BearerExtractionPlugin.py
+2
-7
No files found.
product/ERP5Security/ERP5BearerExtractionPlugin.py
View file @
0b2c77f0
...
...
@@ -33,7 +33,7 @@ from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from
Products.PluggableAuthService.interfaces
import
plugins
from
Products.PluggableAuthService.utils
import
classImplements
from
Products.PluggableAuthService.plugins.BasePlugin
import
BasePlugin
from
Products.ERP5
Security.ERP5UserManager
import
SUPER_USER
from
Products.ERP5
Type.UnrestrictedMethod
import
super_user
from
Products.PluggableAuthService.PluggableAuthService
import
DumbHTTPExtractor
from
AccessControl.SecurityManagement
import
getSecurityManager
,
\
setSecurityManager
,
newSecurityManager
...
...
@@ -96,15 +96,10 @@ class ERP5BearerExtractionPlugin(BasePlugin):
pass
if
token
is
not
None
:
sm
=
getSecurityManager
()
if
sm
.
getUser
().
getId
()
!=
SUPER_USER
:
newSecurityManager
(
self
,
self
.
getUser
(
SUPER_USER
))
try
:
with
super_user
():
reference
=
self
.
Base_extractBearerTokenInformation
(
token
)
if
reference
is
not
None
:
creds
[
'external_login'
]
=
reference
finally
:
setSecurityManager
(
sm
)
if
'external_login'
in
creds
:
creds
[
'remote_host'
]
=
request
.
get
(
'REMOTE_HOST'
,
''
)
try
:
...
...
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