Commit 7398415a authored by Rafael Monnerat's avatar Rafael Monnerat

Added method to return signature as JSON

This could be improved in future as an Accessor or Similar.
parent 7b21969f
......@@ -30,6 +30,7 @@
import os
import sys
import tempfile
import json
from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.CMFCore.utils import getToolByName
......@@ -446,4 +447,17 @@ class IntrospectionTool(LogMixin, BaseTool):
external_connection_dict=self._getExternalConnectionDict(),
business_template_dict=self._getBusinessTemplateRevisionDict(),
business_template_repository_list=business_template_repository_list)
security.declareProtected(Permissions.ManagePortal, 'getSystemSignatureAsJSON')
def getSystemSignatureAsJSON(self, REQUEST=None):
"""
Returns the information as JSON.
THIS merhod could be a decorator or use a some other clever way to convert
the getSystemSignatureDict
"""
if REQUEST is not None:
REQUEST.set("Content-Type", "application/json")
return json.dumps(self.getSystemSignatureDict())
InitializeClass(IntrospectionTool)
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