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
Labels
Merge Requests
138
Merge Requests
138
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
65459160
Commit
65459160
authored
Aug 24, 2022
by
Jérome Perrin
Committed by
Arnaud Fontaine
Mar 08, 2023
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
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()):
return
role_tuple
+
extra_role_tuple
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
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