Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Léo-Paul Géneau
slapos.core
Commits
1f753db4
Commit
1f753db4
authored
May 04, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cut down post copy&paste nonsense.
parent
b605927e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
32 deletions
+1
-32
master/product/Vifib/VifibShadowAuthenticationPlugin.py
master/product/Vifib/VifibShadowAuthenticationPlugin.py
+1
-32
No files found.
master/product/Vifib/VifibShadowAuthenticationPlugin.py
View file @
1f753db4
...
...
@@ -26,7 +26,7 @@
#
##############################################################################
from
zLOG
import
LOG
,
PROBLEM
,
WARNING
from
zLOG
import
LOG
,
PROBLEM
from
Products.ERP5Type.Globals
import
InitializeClass
from
AccessControl
import
ClassSecurityInfo
import
sys
...
...
@@ -43,8 +43,6 @@ from Products.ERP5Type.Cache import transactional_cached
from
Products.ERP5Security.ERP5UserManager
import
SUPER_USER
from
ZODB.POSException
import
ConflictError
from
Products.ERP5Security.ERP5GroupManager
import
ConsistencyError
,
NO_CACHE_MODE
from
Products.ERP5Type.ERP5Type
\
import
ERP5TYPE_SECURITY_GROUP_ID_GENERATION_SCRIPT
from
Products.ERP5Type.Cache
import
CachingMethod
#Form for new plugin in ZMI
...
...
@@ -161,40 +159,12 @@ class VifibShadowAuthenticationPlugin(BasePlugin):
return
()
def
_getGroupsForPrincipal
(
user_name
,
path
):
security_category_dict
=
{}
# key is the base_category_list,
# value is the list of fetched categories
security_group_list
=
[]
security_definition_list
=
()
# because we aren't logged in, we have to create our own
# SecurityManager to be able to access the Catalog
sm
=
getSecurityManager
()
if
sm
.
getUser
().
getId
()
!=
SUPER_USER
:
newSecurityManager
(
self
,
self
.
getUser
(
SUPER_USER
))
try
:
# To get the complete list of groups, we try to call the
# ERP5Type_getSecurityCategoryMapping which should return a list
# of lists of two elements (script, base_category_list) like :
# (
# ('script_1', ['base_category_1', 'base_category_2', ...]),
# ('script_2', ['base_category_1', 'base_category_3', ...])
# )
#
# else, if the script does not exist, falls back to a list containng
# only one list :
# (('ERP5Type_getSecurityCategoryFromAssignment',
# self.getPortalAssignmentBaseCategoryList() ),)
mapping_method
=
getattr
(
self
,
'ERP5Type_getSecurityCategoryMapping'
,
None
)
if
mapping_method
is
None
:
security_definition_list
=
((
'ERP5Type_getSecurityCategoryFromAssignment'
,
self
.
getPortalAssignmentBaseCategoryList
()
),)
else
:
security_definition_list
=
mapping_method
()
# get the loggable document from its reference - no security check needed
catalog_result
=
self
.
portal_catalog
.
unrestrictedSearchResults
(
portal_type
=
self
.
loggable_portal_type_list
,
...
...
@@ -208,7 +178,6 @@ class VifibShadowAuthenticationPlugin(BasePlugin):
repr
([
r
.
getObject
()
for
r
in
catalog_result
]))
else
:
return
()
loggable_object
=
catalog_result
[
0
].
getObject
()
finally
:
setSecurityManager
(
sm
)
...
...
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