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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gabriel Monnerat
erp5
Commits
88a69568
Commit
88a69568
authored
Jun 22, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code improvements suggested by Vincent.
parent
e21b9e1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
product/ERP5Catalog/CatalogTool.py
product/ERP5Catalog/CatalogTool.py
+7
-4
No files found.
product/ERP5Catalog/CatalogTool.py
View file @
88a69568
...
@@ -124,7 +124,7 @@ class IndexableObjectWrapper(object):
...
@@ -124,7 +124,7 @@ class IndexableObjectWrapper(object):
local_roles_group_id_group_id
=
getattr
(
ob
,
local_roles_group_id_group_id
=
getattr
(
ob
,
'__ac_local_roles_group_id_dict__'
,
dict
())
'__ac_local_roles_group_id_dict__'
,
dict
())
allowed_by_local_roles_group_id
=
dict
()
allowed_by_local_roles_group_id
=
{}
allowed_by_local_roles_group_id
[
''
]
=
allowed_role_set
allowed_by_local_roles_group_id
[
''
]
=
allowed_role_set
user_role_dict
=
{}
user_role_dict
=
{}
...
@@ -140,11 +140,14 @@ class IndexableObjectWrapper(object):
...
@@ -140,11 +140,14 @@ class IndexableObjectWrapper(object):
user_view_permission_role_dict
[
role
]
=
user
user_view_permission_role_dict
[
role
]
=
user
elif
role
in
allowed_role_set
:
elif
role
in
allowed_role_set
:
for
group
in
local_roles_group_id_group_id
.
get
(
user
,
(
''
,
)):
for
group
in
local_roles_group_id_group_id
.
get
(
user
,
(
''
,
)):
allowed_by_local_roles_group_id
.
setdefault
(
group
,
set
()).
update
(
try
:
(
prefix
,
'%s:%s'
%
(
prefix
,
role
)))
group_allowed_set
=
allowed_by_local_roles_group_id
[
group
]
except
KeyError
:
allowed_by_local_roles_group_id
[
group
]
=
group_allowed_set
=
set
()
group_allowed_set
.
update
((
prefix
,
'%s:%s'
%
(
prefix
,
role
)))
# sort `allowed` principals
# sort `allowed` principals
sorted_allowed_by_local_roles_group_id
=
dict
()
sorted_allowed_by_local_roles_group_id
=
{}
for
local_roles_group_id
,
allowed
in
\
for
local_roles_group_id
,
allowed
in
\
allowed_by_local_roles_group_id
.
items
():
allowed_by_local_roles_group_id
.
items
():
sorted_allowed_by_local_roles_group_id
[
local_roles_group_id
]
=
tuple
(
sorted_allowed_by_local_roles_group_id
[
local_roles_group_id
]
=
tuple
(
...
...
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