Commit 06bee4b8 authored by Bartek Górny's avatar Bartek Górny

Review and cleanup of generic security scripts.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12926 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5f7301a0
......@@ -77,7 +77,7 @@ Differences to the stock implementation:\n
\n
* if category is source_project, we look for destination_project\n
\n
* if category is group, we return not only the group, but also all its parents\n
* if category not strict, we return not only the category, but also all its parents\n
(unless we say it is strict)\n
"""\n
\n
......@@ -118,13 +118,13 @@ for assignment in person_object.contentValues(filter={\'portal_type\': \'Assignm
else:\n
raise RuntimeError, "Error: \'%s\' property is required in order to update person security group" % (base_category)\n
category_list.append(category_dict)\n
# if it is group, we go up the hierarchy (because if you work in group/a/b/c, chances are you \n
# if not strict, we go up the hierarchy (because if you work in group/a/b/c, chances are you \n
# are working in group/a/b, too :)\n
if base_category == \'group\' and not strict:\n
if not strict:\n
grouplist = category_value.split(\'/\')\n
for i in range(1,len(grouplist)):\n
cdict = category_dict.copy()\n
cdict[\'group\'] = \'/\'.join(grouplist[:-i])\n
cdict[base_category] = \'/\'.join(grouplist[:-i])\n
category_list.append(cdict)\n
except RuntimeError,e:\n
context.log(str(e))\n
......
......@@ -72,13 +72,11 @@
Core security script - defines the way to get security groups of the current user.\n
"""\n
\n
# XXX-JPS This code is quite frightening. I wonder really what it is for.\n
\n
return (\n
(\'ERP5Type_getSecurityCategoryFromAssignmentTree\', [\'function\'] ),\n
(\'ERP5Type_getSecurityCategoryFromAssignmentTree\', [\'source_project\'] ),\n
(\'ERP5Type_getSecurityCategoryFromAssignmentTree\', [\'function\', \'source_project\'] ),\n
(\'ERP5Type_getSecurityCategoryFromAssignmentTree\', [\'group\'] ),\n
(\'ERP5Type_getSecurityCategoryFromAssignmentStrict\', [\'function\'] ),\n
(\'ERP5Type_getSecurityCategoryFromAssignmentStrict\', [\'source_project\'] ),\n
(\'ERP5Type_getSecurityCategoryFromAssignmentStrict\', [\'function\', \'source_project\'] ),\n
(\'ERP5Type_getSecurityCategoryFromAssignmentStrict\', [\'group\'] ),\n
(\'ERP5Type_getSecurityCategoryRoot\', [\'group\']),\n
)\n
</string> </value>
......
537
\ No newline at end of file
540
\ 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