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
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
Hardik Juneja
erp5
Commits
2bec02b9
Commit
2bec02b9
authored
Jul 12, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The structure of __ac_local_roles_group_id_dict__ this requires adjustments in the
way it's exported / imported and tested.
parent
7033e2bf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+5
-5
product/ERP5/tests/testBusinessTemplate.py
product/ERP5/tests/testBusinessTemplate.py
+3
-3
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
2bec02b9
...
@@ -4576,8 +4576,9 @@ class LocalRolesTemplateItem(BaseTemplateItem):
...
@@ -4576,8 +4576,9 @@ class LocalRolesTemplateItem(BaseTemplateItem):
for
principal
,
local_roles_group_id_list
in
sorted
(
local_roles_group_id_dict
.
items
()):
for
principal
,
local_roles_group_id_list
in
sorted
(
local_roles_group_id_dict
.
items
()):
xml_data
+=
"
\
n
<principal id='%s'>"
%
escape
(
principal
)
xml_data
+=
"
\
n
<principal id='%s'>"
%
escape
(
principal
)
for
local_roles_group_id
in
local_roles_group_id_list
:
for
local_roles_group_id
in
local_roles_group_id_list
:
for
item
in
local_roles_group_id
:
xml_data
+=
"
\
n
<local_roles_group_id>%s</local_roles_group_id>"
%
\
xml_data
+=
"
\
n
<local_roles_group_id>%s</local_roles_group_id>"
%
\
escape
(
local_roles_group_id
)
escape
(
item
)
xml_data
+=
"
\
n
</principal>"
xml_data
+=
"
\
n
</principal>"
xml_data
+=
'
\
n
</local_roles_group_id>'
xml_data
+=
'
\
n
</local_roles_group_id>'
...
@@ -4609,10 +4610,9 @@ class LocalRolesTemplateItem(BaseTemplateItem):
...
@@ -4609,10 +4610,9 @@ class LocalRolesTemplateItem(BaseTemplateItem):
# local roles group id
# local roles group id
local_roles_group_id_dict
=
{}
local_roles_group_id_dict
=
{}
for
principal
in
xml
.
findall
(
'//principal'
):
for
principal
in
xml
.
findall
(
'//principal'
):
local_roles_group_id_dict
[
principal
.
get
(
'id'
)]
=
tuple
(
local_roles_group_id_dict
[
principal
.
get
(
'id'
)]
=
set
([
tuple
(
[
group_id
.
text
for
group_id
in
[
group_id
.
text
for
group_id
in
principal
.
findall
(
'./local_roles_group_id'
)])
principal
.
findall
(
'./local_roles_group_id'
)])])
self
.
_objects
[
'local_roles/%s'
%
(
file_name
[:
-
4
],)]
=
(
self
.
_objects
[
'local_roles/%s'
%
(
file_name
[:
-
4
],)]
=
(
local_roles_dict
,
local_roles_group_id_dict
)
local_roles_dict
,
local_roles_group_id_dict
)
...
...
product/ERP5/tests/testBusinessTemplate.py
View file @
2bec02b9
...
@@ -6553,8 +6553,8 @@ class TestBusinessTemplate(BusinessTemplateMixin):
...
@@ -6553,8 +6553,8 @@ class TestBusinessTemplate(BusinessTemplateMixin):
# simulate role assignment
# simulate role assignment
new_object
.
__ac_local_roles__
=
dict
(
group
=
[
'Assignee'
])
new_object
.
__ac_local_roles__
=
dict
(
group
=
[
'Assignee'
])
new_object
.
__ac_local_roles_group_id_dict__
=
dict
(
group
=
(
'Alternate'
,
))
initial___ac_local_roles_group_id_dict__
=
dict
(
Alternate
=
set
([(
'group'
,
'Assignee'
)]
))
new_object
.
__ac_local_roles_group_id_dict__
=
initial___ac_local_roles_group_id_dict__
self
.
tic
()
self
.
tic
()
object_type
.
newContent
(
portal_type
=
'Role Information'
,
object_type
.
newContent
(
portal_type
=
'Role Information'
,
...
@@ -6592,7 +6592,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
...
@@ -6592,7 +6592,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
path
=
self
.
portal
.
geek_module
[
'1'
]
path
=
self
.
portal
.
geek_module
[
'1'
]
self
.
assertEquals
([(
'group'
,
[
'Assignee'
],)],
[
item
for
item
in
self
.
assertEquals
([(
'group'
,
[
'Assignee'
],)],
[
item
for
item
in
path
.
__ac_local_roles__
.
items
()
if
item
[
1
]
!=
[
'Owner'
]])
path
.
__ac_local_roles__
.
items
()
if
item
[
1
]
!=
[
'Owner'
]])
self
.
assertEquals
(
dict
(
group
=
(
'Alternate'
,))
,
self
.
assertEquals
(
initial___ac_local_roles_group_id_dict__
,
path
.
__ac_local_roles_group_id_dict__
)
path
.
__ac_local_roles_group_id_dict__
)
finally
:
finally
:
# restore state
# restore state
...
...
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