Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5_fork
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
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
Eteri
erp5_fork
Commits
1f7ad4f9
Commit
1f7ad4f9
authored
Mar 17, 2015
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_administration: fix z_refresh_roles_and_users script
parent
f8edef9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/z_refresh_roles_and_users.xml
...l_skins/erp5_administration/z_refresh_roles_and_users.xml
+3
-3
product/ZSQLCatalog/SQLCatalog.py
product/ZSQLCatalog/SQLCatalog.py
+8
-3
No files found.
bt5/erp5_administration/SkinTemplateItem/portal_skins/erp5_administration/z_refresh_roles_and_users.xml
View file @
1f7ad4f9
...
...
@@ -31,9 +31,9 @@
DELETE FROM roles_and_users\n
<dtml-var sql_delimiter>
\n
INSERT INTO roles_and_users (uid, allowedRolesAndUsers) VALUES\n
<dtml-in
expr
=
"role"
expr=
"getPortalObject().portal_catalog.getSQLCatalog().getRoleAndSecurityUidList()"
>
\n
(
<dtml-sqlvar
expr=
"role_item[
0]"
type=
"int"
>
,
<dtml-sqlvar
expr=
"role_item[1]"
type=
"string"
>
,
<dtml-sqlvar
expr=
"role_item[2]"
type=
"string"
>
)
<dtml-if
sequence-end
><dtml-else>
,
</dtml-if>
\n
\n
<dtml-in
prefix
=
"role"
expr=
"getPortalObject().portal_catalog.getSQLCatalog().getRoleAndSecurityUidList()"
>
\n
(
<dtml-sqlvar
expr=
"role_item[
2]"
type=
"int"
>
,
<dtml-sqlvar
expr=
"role_item[1]"
type=
"string"
>
)
<dtml-if
sequence-end
><dtml-else>
,
\n
</dtml-if>
\n
</dtml-in>
]]>
</string>
</value>
...
...
product/ZSQLCatalog/SQLCatalog.py
View file @
1f7ad4f9
...
...
@@ -889,14 +889,19 @@ class Catalog(Folder,
def
getRoleAndSecurityUidList
(
self
):
"""
Return a list of
2
-tuples, suitable for direct use in a zsqlmethod.
Return a list of
3
-tuples, suitable for direct use in a zsqlmethod.
Goal: make it possible to regenerate a table containing this data.
"""
result
=
[]
extend
=
result
.
extend
for
role_list
,
security_uid
in
getattr
(
aq_base
(
self
),
'security_uid_dict'
,
{}).
iteritems
():
extend
([(
role
,
security_uid
)
for
role
in
role_list
])
if
role_list
:
if
isinstance
(
role_list
[
-
1
],
tuple
):
local_role_group_id
,
role_list
=
role_list
else
:
local_role_group_id
=
''
result
+=
[(
local_role_group_id
,
role
,
security_uid
)
for
role
in
role_list
]
return
result
security
.
declarePrivate
(
'getSubjectSetUid'
)
...
...
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