<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>Script_magic</string> </key>
            <value> <int>3</int> </value>
        </item>
        <item>
            <key> <string>_bind_names</string> </key>
            <value>
              <object>
                <klass>
                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>_asgns</string> </key>
                        <value>
                          <dictionary>
                            <item>
                                <key> <string>name_container</string> </key>
                                <value> <string>container</string> </value>
                            </item>
                            <item>
                                <key> <string>name_context</string> </key>
                                <value> <string>context</string> </value>
                            </item>
                            <item>
                                <key> <string>name_m_self</string> </key>
                                <value> <string>script</string> </value>
                            </item>
                            <item>
                                <key> <string>name_subpath</string> </key>
                                <value> <string>traverse_subpath</string> </value>
                            </item>
                          </dictionary>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>_body</string> </key>
            <value> <string>from zExceptions import Unauthorized\n
from AccessControl import getSecurityManager\n
if REQUEST is None:\n
  raise Unauthorized\n
\n
response = REQUEST.RESPONSE\n
type = \'application/vnd.slapos.org.hal+json; class=slapos.org.master\'\n
\n
if REQUEST.other[\'method\'] != "GET":\n
  response.setStatus(405)\n
  return ""\n
elif type != context.Base_handleAcceptHeader([type]):\n
  response.setStatus(406)\n
  return ""\n
else:\n
  import json\n
  result_dict = {\n
      \'_class\': \'slapos.org.master\',\n
#       \'title\': \'Vifib SlapOS Master\',\n
#       \'description\': \'Reference implementation of the SlapOS Master specifications.\',\n
      \'_links\': {\n
        "self": { "href": context.Base_getRequestUrl(),\n
                  "type": type },\n
#         "http://slapos.org/reg/edit": {\n
#           "href": "/edit",\n
#           "method": "PUT",\n
#           "type": "application/json; class=slapos.org.master",\n
#         },\n
#         "http://slapos.org/reg/create": {\n
#           "href": "/new",\n
#           "method": "POST",\n
#           "type": "application/json; class=slapos.org.person",\n
#         },\n
      },\n
    }\n
\n
  portal = context.getPortalObject()\n
\n
  # XXX Handle also other kind of users: instance, computer, master\n
  person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
  if person is not None:\n
    result_dict[\'_links\'][\'http://slapos.org/reg/me\'] = {\n
      \'href\': \'%s/Person_getHateoas\' % person.absolute_url(),\n
      "type": "application/vnd.slapos.org.hal+json; class=slapos.org.person"\n
    }\n
\n
  response.setHeader(\'Content-Type\', type)\n
  return json.dumps(result_dict)\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>REQUEST=None</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>Base_getHateoasMaster</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
