<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <tuple>
        <tuple>
          <string>Products.PythonScripts.PythonScript</string>
          <string>PythonScript</string>
        </tuple>
        <none/>
      </tuple>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>Python_magic</string> </key>
            <value> <string encoding="base64">O/INCg==</string> </value>
        </item>
        <item>
            <key> <string>Script_magic</string> </key>
            <value> <int>3</int> </value>
        </item>
        <item>
            <key> <string>__ac_local_roles__</string> </key>
            <value>
              <none/>
            </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># category_order : list of base_categories we want to use to generate the group id\n
# kw : keys should be base categories,\n
#      values should be value of corresponding relative urls (obtained by getBaseCategory())\n
#\n
# Example call : context.ERP5TypeSecurity_asGroupId(category_order=(\'site\', \'group\', \'function\'),\n
#                    site=\'france/lille\', group=\'nexedi\', function=\'accounting/accountant\')\n
# This will generate a string like \'LIL_NXD_ACT\' where "LIL", "NXD" and "ACT" are the codification\n
#   of respecively "france/lille", "nexedi" and "accounting/accountant" categories\n
\n
code_list = []\n
\n
# sort the category list lexicographically\n
# this prevents us to choose the exact order we want,\n
# but also prevents some human mistake to f*ck everything up by creating site_function instead of function_site\n
if category_order not in (None, \'\'):\n
  category_order = [ x for x in category_order]\n
  category_order.sort()\n
else:\n
  category_order = []\n
\n
for base_category in category_order:\n
  category        = kw[base_category]\n
  category_path   = \'%s/%s\' % (base_category, category)\n
  category_object = context.portal_categories.getCategoryValue(category_path)\n
  if category_object in (None, \'\'):\n
    raise "SecurityRoleDefinitionError", "Category \'%s\' doesn\'t exist" % (category_path)\n
  category_code   = category_object.getCodification() or category_object.getId()\n
  code_list.append(category_code)\n
\n
return \'_\'.join(code_list)\n
</string> </value>
        </item>
        <item>
            <key> <string>_code</string> </key>
            <value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAQAAABAAAAAOAAAASwAA
AHMnAQAAZwAAfQIAfAAAdAIAZAEAZgIAagcAb0EAAWcAAARpAwB9BQB0BQB8AACDAQBEXRAAfQcA
fAUAfAcAgwEAAXEtAH4FAH0AAHQHAHwAAGQCAIMCAIMAAAFuBwABZwAAfQAAeK0AdAUAfAAAgwEA
RF2fAH0JAHQJAHwBAHwJAIMCAH0LAGQDAHwJAHwLAGYCABZ9DAB0BwB0BwB0DQBkBACDAgBkBQCD
AgB8DACDAQB9DgB8DgB0AgBkAQBmAgBqBgBvEQABZAYAZAcAfAwAFoICAG4BAAF0BwB8DgBkCACD
AgCDAABwEAABdAcAfA4AZAkAgwIAgwAAfQ8AdAcAfAIAZAoAgwIAfA8AgwEAAXFtAFd0BwBkCwBk
DACDAgB8AgCDAQBTZAAAUygNAAAATnMAAAAAcwQAAABzb3J0cwUAAAAlcy8lc3MRAAAAcG9ydGFs
X2NhdGVnb3JpZXNzEAAAAGdldENhdGVnb3J5VmFsdWVzGwAAAFNlY3VyaXR5Um9sZURlZmluaXRp
b25FcnJvcnMbAAAAQ2F0ZWdvcnkgJyVzJyBkb2Vzbid0IGV4aXN0cw8AAABnZXRDb2RpZmljYXRp
b25zBQAAAGdldElkcwYAAABhcHBlbmRzAQAAAF9zBAAAAGpvaW4oEAAAAHMJAAAAY29kZV9saXN0
cw4AAABjYXRlZ29yeV9vcmRlcnMEAAAATm9uZXMGAAAAYXBwZW5kcwgAAAAkYXBwZW5kMHMJAAAA
X2dldGl0ZXJfcwEAAAB4cwkAAABfZ2V0YXR0cl9zDQAAAGJhc2VfY2F0ZWdvcnlzCQAAAF9nZXRp
dGVtX3MCAAAAa3dzCAAAAGNhdGVnb3J5cw0AAABjYXRlZ29yeV9wYXRocwcAAABjb250ZXh0cw8A
AABjYXRlZ29yeV9vYmplY3RzDQAAAGNhdGVnb3J5X2NvZGUoEAAAAHMOAAAAY2F0ZWdvcnlfb3Jk
ZXJzAgAAAGt3cwkAAABjb2RlX2xpc3RzBAAAAE5vbmVzBgAAAGFwcGVuZHMIAAAAJGFwcGVuZDBz
CQAAAF9nZXRpdGVyX3MBAAAAeHMJAAAAX2dldGF0dHJfcw0AAABiYXNlX2NhdGVnb3J5cwkAAABf
Z2V0aXRlbV9zCAAAAGNhdGVnb3J5cw0AAABjYXRlZ29yeV9wYXRocwcAAABjb250ZXh0cw8AAABj
YXRlZ29yeV9vYmplY3RzDQAAAGNhdGVnb3J5X2NvZGUoAAAAACgAAAAAcw8AAABTY3JpcHQgKFB5
dGhvbilzGgAAAEVSUDVUeXBlX2FzU2VjdXJpdHlHcm91cElkAQAAAHMgAAAAAAkGBRMBFAAcAREC
BgINAAYBDwEQAR4BEwERASgBFAIoAQAAAHMaAAAARVJQNVR5cGVfYXNTZWN1cml0eUdyb3VwSWQo
AQAAAHMaAAAARVJQNVR5cGVfYXNTZWN1cml0eUdyb3VwSWQoAAAAACgAAAAAcw8AAABTY3JpcHQg
KFB5dGhvbilzCAAAADxtb2R1bGU+AQAAAHMAAAAA</string> </value>
        </item>
        <item>
            <key> <string>_filepath</string> </key>
            <value> <string>Script (Python):/nexedi/portal_skins/erp5_core/ERP5Type_asSecurityGroupId</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>category_order, **kw</string> </value>
        </item>
        <item>
            <key> <string>errors</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
        <item>
            <key> <string>func_code</string> </key>
            <value>
              <object>
                <klass>
                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>co_argcount</string> </key>
                        <value> <int>1</int> </value>
                    </item>
                    <item>
                        <key> <string>co_varnames</string> </key>
                        <value>
                          <tuple>
                            <string>category_order</string>
                            <string>kw</string>
                            <string>code_list</string>
                            <string>None</string>
                            <string>append</string>
                            <string>$append0</string>
                            <string>_getiter_</string>
                            <string>x</string>
                            <string>_getattr_</string>
                            <string>base_category</string>
                            <string>_getitem_</string>
                            <string>category</string>
                            <string>category_path</string>
                            <string>context</string>
                            <string>category_object</string>
                            <string>category_code</string>
                          </tuple>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>func_defaults</string> </key>
            <value>
              <none/>
            </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>ERP5Type_asSecurityGroupId</string> </value>
        </item>
        <item>
            <key> <string>warnings</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
