From 06bee4b8b28726a4c7307038da38103efb457a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20G=C3=B3rny?= <bartek@gorny.edu.pl> Date: Wed, 21 Feb 2007 09:09:39 +0000 Subject: [PATCH] Review and cleanup of generic security scripts. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12926 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../ERP5Type_getSecurityCategoryFromAssignmentTree.xml | 8 ++++---- .../erp5_dms/ERP5Type_getSecurityCategoryMapping.xml | 10 ++++------ bt5/erp5_dms/bt/revision | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentTree.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentTree.xml index ad95fb750a..18e4399573 100644 --- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentTree.xml +++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryFromAssignmentTree.xml @@ -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 diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryMapping.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryMapping.xml index 79af6423bb..9c3741dd71 100644 --- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryMapping.xml +++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ERP5Type_getSecurityCategoryMapping.xml @@ -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> diff --git a/bt5/erp5_dms/bt/revision b/bt5/erp5_dms/bt/revision index d759b56ecc..06e8971dc6 100644 --- a/bt5/erp5_dms/bt/revision +++ b/bt5/erp5_dms/bt/revision @@ -1 +1 @@ -537 \ No newline at end of file +540 \ No newline at end of file -- 2.30.9