Commit 99d95468 authored by Yoshinori Okuji's avatar Yoshinori Okuji

If the user can manage the portal, do not hide any content types.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35366 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f8a39969
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
############################################################################## ##############################################################################
import transaction import transaction
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo, getSecurityManager
from Acquisition import aq_base, aq_parent, aq_inner from Acquisition import aq_base, aq_parent, aq_inner
from OFS.History import Historical from OFS.History import Historical
import ExtensionClass import ExtensionClass
...@@ -44,6 +44,7 @@ from Products.ERP5Type import PropertySheet ...@@ -44,6 +44,7 @@ from Products.ERP5Type import PropertySheet
from Products.ERP5Type.XMLExportImport import Folder_asXML from Products.ERP5Type.XMLExportImport import Folder_asXML
from Products.ERP5Type.Utils import sortValueList from Products.ERP5Type.Utils import sortValueList
from Products.ERP5Type.WebDAVSupport import Folder as WebDAVFolder from Products.ERP5Type.WebDAVSupport import Folder as WebDAVFolder
from Products.ERP5Type import Permissions
try: try:
from Products.CMFCore.CMFBTreeFolder import CMFBTreeFolder from Products.CMFCore.CMFBTreeFolder import CMFBTreeFolder
...@@ -1308,6 +1309,11 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn, ...@@ -1308,6 +1309,11 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn,
""" """
portal = self.getPortalObject() portal = self.getPortalObject()
# If the user can manage the portal, do not hide any content types.
sm = getSecurityManager()
if sm.checkPermission(Permissions.ManagePortal, portal):
return [ti.id for ti in self.allowedContentTypes()]
hidden_type_list = portal.portal_types.getTypeInfo(self)\ hidden_type_list = portal.portal_types.getTypeInfo(self)\
.getTypeHiddenContentTypeList() .getTypeHiddenContentTypeList()
return [ ti.id for ti in self.allowedContentTypes() return [ ti.id for ti in self.allowedContentTypes()
......
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