Commit 2548346d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

SelectionTool management methods should not be added in FolderMixIn.

Also methods without a security declaration should not be added.
parent 1a97187a
......@@ -1785,7 +1785,20 @@ from Products.ERP5Type.Core.Folder import FolderMixIn
from ZPublisher.mapply import mapply
method_id_filter_list = [x for x in FolderMixIn.__dict__ if callable(getattr(FolderMixIn, x))]
candidate_method_id_list = [x for x in SelectionTool.__dict__ if callable(getattr(SelectionTool, x)) and not x.startswith('_') and not x.endswith('__roles__') and x not in method_id_filter_list]
candidate_method_id_list = []
for x in SelectionTool.__dict__:
if not callable(getattr(SelectionTool, x)):
continue
if x.startswith('_') or x.endswith('__roles__'):
continue
if x in method_id_filter_list:
continue
roles = getattr(SelectionTool, '%s__roles__' % x, None)
if roles is None:
continue
if roles.__name__ == ERP5Permissions.ManagePortal:
continue
candidate_method_id_list.append(x)
# Monkey patch FolderMixIn with SelectionTool methods
# kept here for compatibility with previous implementations
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment