Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Romain Courteaud
erp5_rtl_support
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 @@
...
@@ -31,9 +31,9 @@
DELETE FROM roles_and_users\n
DELETE FROM roles_and_users\n
<dtml-var sql_delimiter>
\n
<dtml-var sql_delimiter>
\n
INSERT INTO roles_and_users (uid, allowedRolesAndUsers) VALUES\n
INSERT INTO roles_and_users (uid, allowedRolesAndUsers) VALUES\n
<dtml-in
expr
=
"role"
expr=
"getPortalObject().portal_catalog.getSQLCatalog().getRoleAndSecurityUidList()"
>
\n
<dtml-in
prefix
=
"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
(
<dtml-sqlvar
expr=
"role_item[
2]"
type=
"int"
>
,
<dtml-sqlvar
expr=
"role_item[1]"
type=
"string"
>
)
<dtml-if
sequence-end
><dtml-else>
,
\n
\n
</dtml-if>
\n
</dtml-in>
</dtml-in>
]]>
</string>
</value>
]]>
</string>
</value>
...
...
product/ZSQLCatalog/SQLCatalog.py
View file @
1f7ad4f9
...
@@ -889,14 +889,19 @@ class Catalog(Folder,
...
@@ -889,14 +889,19 @@ class Catalog(Folder,
def
getRoleAndSecurityUidList
(
self
):
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.
Goal: make it possible to regenerate a table containing this data.
"""
"""
result
=
[]
result
=
[]
extend
=
result
.
extend
for
role_list
,
security_uid
in
getattr
(
for
role_list
,
security_uid
in
getattr
(
aq_base
(
self
),
'security_uid_dict'
,
{}).
iteritems
():
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
return
result
security
.
declarePrivate
(
'getSubjectSetUid'
)
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