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
Paul Graydon
erp5
Commits
65459160
Commit
65459160
authored
2 years ago
by
Jérome Perrin
Committed by
Arnaud Fontaine
1 year ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "ERP5Type/patches/User: drop SimpleUser.getRolesInContext patch"
This reverts commit
bf230f1f
. pushed by mistake
parent
96424c4c
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
product/ERP5Type/patches/User.py
product/ERP5Type/patches/User.py
+30
-0
No files found.
product/ERP5Type/patches/User.py
View file @
65459160
...
@@ -59,3 +59,33 @@ def getRoles(self, _transactional_variable_pool=local()):
...
@@ -59,3 +59,33 @@ def getRoles(self, _transactional_variable_pool=local()):
return
role_tuple
+
extra_role_tuple
return
role_tuple
+
extra_role_tuple
SimpleUser
.
getRoles
=
getRoles
SimpleUser
.
getRoles
=
getRoles
def
getRolesInContext
(
self
,
object
):
"""
Return the list of roles assigned to the user, including local roles
assigned in context of the passed in object.
"""
userid
=
self
.
getId
()
result
=
set
()
object
=
aq_inner
(
object
)
while
1
:
local_role_dict
=
getattr
(
object
,
'__ac_local_roles__'
,
None
)
if
local_role_dict
:
if
callable
(
local_role_dict
):
local_role_dict
=
local_role_dict
()
or
{}
result
.
update
(
local_role_dict
.
get
(
userid
,
()))
parent
=
aq_parent
(
aq_inner
(
object
))
if
parent
is
not
None
:
object
=
parent
continue
new
=
getattr
(
object
,
'__self__'
,
None
)
if
new
is
not
None
:
object
=
aq_inner
(
new
)
continue
break
# Patched: Developer role should never be available as local role
result
.
discard
(
DEVELOPER_ROLE_ID
)
result
.
update
(
self
.
getRoles
())
return
list
(
result
)
SimpleUser
.
getRolesInContext
=
getRolesInContext
This diff is collapsed.
Click to expand it.
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