Commit 4c1008f5 authored by Alexandre Boeglin's avatar Alexandre Boeglin

Secutiry update :

If we decide in the security script that we don't want to update the
assigned roles for this object, we can just have it return None instead of
a dict or list of dicts.

This may happen for example when a site manager creates a new object.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3837 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cbb36d89
......@@ -228,6 +228,10 @@ class ERP5TypeInformation( FactoryTypeInformation, RoleProviderBase ):
if base_category_script is not None:
# call the script, which should return either a dict or a list of dicts
category_result = base_category_script(actual_base_category_list, user_name, object, object.getPortalType())
# If we decide in the script that we don't want to update the security for this object,
# we can just have it return None instead of a dict or list of dicts
if category_result is None:
return
if type(category_result) is type({}):
category_result = [category_result]
else:
......
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