Commit 9d895561 authored by Łukasz Nowak's avatar Łukasz Nowak

- make script data-error proof - otherwise small error leads to unusable user interface

 - newer XML serialisation


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27348 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 41e33afb
...@@ -53,7 +53,9 @@ ...@@ -53,7 +53,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string encoding="cdata"><![CDATA[
"""\n
Implementation of a highly sophisticated security system. Context has a security classification\n Implementation of a highly sophisticated security system. Context has a security classification\n
like "personal/project", "collaborative/public" etc and we check if a given policy or a set of \n like "personal/project", "collaborative/public" etc and we check if a given policy or a set of \n
policies (defined with wildcard, like "personal/*" or "*/project") applies to the context.\n policies (defined with wildcard, like "personal/*" or "*/project") applies to the context.\n
...@@ -68,7 +70,6 @@ this check can be skipped by setting membershiponly to True.\n ...@@ -68,7 +70,6 @@ this check can be skipped by setting membershiponly to True.\n
klass = context.getClassification()\n klass = context.getClassification()\n
if klass is None: return False\n if klass is None: return False\n
kl = klass.split(\'/\')\n kl = klass.split(\'/\')\n
\n
if len(kl) == 1:\n if len(kl) == 1:\n
# personal = personal/restricted\n # personal = personal/restricted\n
if kl[0] == \'personal\': kl.append(\'restricted\')\n if kl[0] == \'personal\': kl.append(\'restricted\')\n
...@@ -87,9 +88,14 @@ if not membershiponly:\n ...@@ -87,9 +88,14 @@ if not membershiponly:\n
if context.getFollowUp() == None:\n if context.getFollowUp() == None:\n
return False\n return False\n
\n \n
# if all conditions are met, check if the policy is ok (wildcards are ok)\n if len(pol) >= 2 and len(kl) >= 2:\n
return (pol[0] in (\'*\', kl[0])) and (pol[1] in (\'*\', kl[1]))\n # if all conditions are met, check if the policy is ok (wildcards are ok)\n
</string> </value> return (pol[0] in (\'*\', kl[0])) and (pol[1] in (\'*\', kl[1]))\n
\n
return False\n
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
......
983 986
\ No newline at end of file \ No newline at end of file
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