Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Richard
erp5
Commits
bd23b72e
Commit
bd23b72e
authored
Jul 09, 2018
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Catalog: Allow not relying on catalog to index documents in catalog.
But still rely on it by default.
parent
80844559
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
6 deletions
+29
-6
product/ERP5Catalog/CatalogTool.py
product/ERP5Catalog/CatalogTool.py
+29
-6
No files found.
product/ERP5Catalog/CatalogTool.py
View file @
bd23b72e
...
@@ -852,12 +852,34 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
...
@@ -852,12 +852,34 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
"""
"""
return
ZCatalog
.
countResults
(
self
,
REQUEST
,
**
kw
)
return
ZCatalog
.
countResults
(
self
,
REQUEST
,
**
kw
)
def
_filterUserIdSet
(
id_set
):
"""
This is the historical implementation answering the need to sort out
which identifiers are actual users, the others being assumed to be
security groups.
The issue with this approach is that searchUsers, when involving
ERP5 user plugins, relies on the catalog. Which means that if a user
document (ex: Person) grants a local role to its user, the first
indexation will be unable to find that user through searchUsers, and
hence will assume it is a security group. In turn, this means that
role-specific catalog columns cannot be used for this role on such
document, causing a security uid to be allocated. On second
reindexation, the user will be properly identified as a user, but
security uids are never de-allocated and so the cost of having that
extra entry around (longer list of possible values applying to
security_uid column) will persist.
"""
return
(
x
[
'id'
]
for
x
in
self
.
getPortalObject
().
acl_users
.
searchUsers
(
id
=
list
(
id_set
),
exact_match
=
True
,
)
)
def
wrapObjectList
(
self
,
object_value_list
,
catalog_value
):
def
wrapObjectList
(
self
,
object_value_list
,
catalog_value
):
"""
"""
Return a list of wrapped objects for reindexing.
Return a list of wrapped objects for reindexing.
"""
"""
portal
=
self
.
getPortalObject
()
user_set
=
set
()
user_set
=
set
()
catalog_role_set
=
{
x
for
x
,
_
in
catalog_value
.
getSQLCatalogRoleKeysList
()}
catalog_role_set
=
{
x
for
x
,
_
in
catalog_value
.
getSQLCatalogRoleKeysList
()}
catalog_security_uid_groups_columns_dict
=
catalog_value
.
getSQLCatalogSecurityUidGroupsColumnsDict
()
catalog_security_uid_groups_columns_dict
=
catalog_value
.
getSQLCatalogSecurityUidGroupsColumnsDict
()
...
@@ -896,10 +918,11 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
...
@@ -896,10 +918,11 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
# affected by this, which must happen before _getSecurityParameterList
# affected by this, which must happen before _getSecurityParameterList
# is called (which happens when calling getSecurityUidDict below).
# is called (which happens when calling getSecurityUidDict below).
user_set
.
update
(
user_set
.
update
(
x
[
'id'
]
for
x
in
portal
.
acl_users
.
searchUsers
(
getattr
(
id
=
list
(
security_group_set
),
self
,
exact_match
=
True
,
'ERP5Site_filterUserIdSet'
,
)
self
.
_filterUserIdSet
,
)(
security_group_set
),
)
)
getSecurityUidDict
=
catalog_value
.
getSecurityUidDict
getSecurityUidDict
=
catalog_value
.
getSecurityUidDict
...
...
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