<?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>network = context\n
\n
# XXX - The use of current authenticated person will return always \'Close\' if \n
#       the person is administrator (such as \'zope\' user) but not the owner of computer\n
#       \n
#       person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
allocation_state = \'Close\'\n
software_type = \'\'\n
filter_kw = {}\n
\n
for computer in network.getSubordinationRelatedValueList():\n
  person = computer.getSourceAdministrationValue()\n
  filter_kw[\'computer_guid\']=computer.getReference()\n
  try:\n
    isAllowed =  person.Person_restrictMethodAsShadowUser(shadow_document=person,\n
          callable_object=person.Person_findPartition,\n
          argument_list=[software_release_url, software_type, \'Software Instance\',\n
                         filter_kw], \n
          argument_dict={\'test_mode\': True}\n
    )\n
    if isAllowed:\n
      allocation_state = \'Open\'\n
      break\n
  except:\n
    continue\n
\n
return allocation_state\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>software_release_url</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>ComputerNetwork_getSoftwareReleaseAllocableState</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
