X-Git-Url: https://scm.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/959d888c17d1403d2eeecc19bc4b5e2c8d1debf6..4778261ea24f62ab9c7e66b3464ef15ca8d3371c:/Products/Plinn/utils.py?ds=sidebyside diff --git a/Products/Plinn/utils.py b/Products/Plinn/utils.py index de68f22..15536b0 100755 --- a/Products/Plinn/utils.py +++ b/Products/Plinn/utils.py @@ -24,10 +24,10 @@ import string import re -from types import StringType from random import randrange from Acquisition import aq_base from quopri import encodestring +from json import dumps as json_dumps from zope.globalrequest import getRequest from AccessControl.PermissionRole import rolesForPermissionOn from AccessControl import ModuleSecurityInfo @@ -49,6 +49,8 @@ _marker = [] security = ModuleSecurityInfo( 'Products.Plinn.utils' ) +security.declarePublic('json_dumps') + security.declarePublic('thisObjectComeFromPortalSkin') def thisObjectComeFromPortalSkin(ob, portal=None): """ check if ob comes from portal_skins """ @@ -76,10 +78,10 @@ def thisObjectComeFromPortalSkin(ob, portal=None): except BadRequest : return False -security.declarePublic('listActionProviders_') -def listActionProviders_(context) : - atool = getToolByName(context, 'portal_actions') - return atool.listActionProviders() +security.declarePublic('listWorkflowActions') +def listWorkflowActions(context) : + wftool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IWorkflowTool') + return wftool.listActions(object=context) def capitalizeCompoundGivenName(givenName) : givenName = givenName.strip()