Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
d03debfb
Commit
d03debfb
authored
Jun 16, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop getToolByName usage.
parent
953e369c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
product/ERP5/Tool/IntrospectionTool.py
product/ERP5/Tool/IntrospectionTool.py
+7
-5
No files found.
product/ERP5/Tool/IntrospectionTool.py
View file @
d03debfb
...
...
@@ -71,15 +71,16 @@ class IntrospectionTool(LogMixin, BaseTool):
Returns menu items for a given user
"""
portal
=
self
.
getPortalObject
()
is_portal_manager
=
getToolByName
(
portal
,
'portal_membership'
).
checkPermission
(
Permissions
.
ManagePortal
,
self
)
is_portal_manager
=
portal
.
portal_membership
.
checkPermission
(
\
Permissions
.
ManagePortal
,
self
)
downgrade_authenticated_user
=
user_name
is
not
_MARKER
and
is_portal_manager
if
downgrade_authenticated_user
:
# downgrade to desired user
original_security_manager
=
_setSuperSecurityManager
(
self
,
user_name
)
# call the method implementing it
erp5_menu_dict
=
getToolByName
(
portal
,
'portal_actions'
)
.
listFilteredActionsFor
(
portal
)
erp5_menu_dict
=
portal
.
portal_actions
.
listFilteredActionsFor
(
portal
)
if
downgrade_authenticated_user
:
# restore original Security Manager
...
...
@@ -99,8 +100,9 @@ class IntrospectionTool(LogMixin, BaseTool):
Returns module items for a given user
"""
portal
=
self
.
getPortalObject
()
is_portal_manager
=
getToolByName
(
portal
,
'portal_membership'
).
checkPermission
(
Permissions
.
ManagePortal
,
self
)
is_portal_manager
=
portal
.
portal_membership
.
checkPermission
(
Permissions
.
ManagePortal
,
self
)
downgrade_authenticated_user
=
user_name
is
not
_MARKER
and
is_portal_manager
if
downgrade_authenticated_user
:
# downgrade to desired user
...
...
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