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
alecs_myu
erp5
Commits
1060185f
Commit
1060185f
authored
Oct 09, 2014
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reset Owner role to object owner when updating local roles
parent
6a8987fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
product/ERP5Type/ERP5Type.py
product/ERP5Type/ERP5Type.py
+8
-7
No files found.
product/ERP5Type/ERP5Type.py
View file @
1060185f
...
...
@@ -87,9 +87,14 @@ class LocalRoleAssignorMixIn(object):
if
owner
:
user_name
=
owner
[
1
]
else
:
user_name
=
getSecurityManager
().
getUser
().
getId
()
group_id_role_dict
=
{}
for
group
,
role_list
in
(
ob
.
__ac_local_roles__
or
{}).
iteritems
():
if
'Owner'
in
role_list
:
user_name
=
group
break
else
:
user_name
=
getSecurityManager
().
getUser
().
getId
()
group_id_role_dict
=
{
user_name
:
set
((
'Owner'
,))}
local_roles_group_id_group_id
=
{}
# Merge results from applicable roles
for
role_generator
in
self
.
getFilteredRoleListFor
(
ob
):
...
...
@@ -110,10 +115,6 @@ class LocalRoleAssignorMixIn(object):
local_roles_group_id_group_id
.
setdefault
(
local_roles_group_id
,
set
()).
update
(((
group_id
,
role
),))
## Update role assignments to groups
# Save the owner
for
group
,
role_list
in
(
ob
.
__ac_local_roles__
or
{}).
iteritems
():
if
'Owner'
in
role_list
:
group_id_role_dict
.
setdefault
(
group
,
set
()).
add
(
'Owner'
)
# Assign new roles
ac_local_roles
=
{}
for
group
,
role_list
in
group_id_role_dict
.
iteritems
():
...
...
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