Commit 50a6e1d1 authored by Jean-Paul Smets's avatar Jean-Paul Smets

strip category. Provide user as string (should be as ERP5 object in future)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3003 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 88b9591a
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
$Id$ $Id$
""" """
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo, getSecurityManager
from Globals import InitializeClass from Globals import InitializeClass
from Acquisition import aq_inner, aq_parent from Acquisition import aq_inner, aq_parent
from OFS.SimpleItem import SimpleItem from OFS.SimpleItem import SimpleItem
...@@ -105,7 +105,7 @@ class RoleInformation( SimpleItem ): ...@@ -105,7 +105,7 @@ class RoleInformation( SimpleItem ):
if self.user: if self.user:
info['user'] = self.user( ec ) or None info['user'] = self.user( ec ) or None
else: else:
info['user'] = 'The Default User XXX' info['user'] = getSecurityManager().getUser() # XXX The user should be a handle to the Person object
info['category'] = self.getCategory() info['category'] = self.getCategory()
info['base_category'] = self.getBaseCategory() info['base_category'] = self.getBaseCategory()
return info return info
...@@ -143,8 +143,10 @@ class RoleInformation( SimpleItem ): ...@@ -143,8 +143,10 @@ class RoleInformation( SimpleItem ):
""" Return the category """ Return the category
as a tuple (to prevent script from modifying it) as a tuple (to prevent script from modifying it)
Strip any return or ending space
""" """
return tuple(filter(lambda x: x, self.category)) or () return tuple(map(lambda x: x.strip(), filter(lambda x: x, self.category))) or ()
security.declarePublic( 'getBaseCategory' ) security.declarePublic( 'getBaseCategory' )
def getBaseCategory( self ): def getBaseCategory( self ):
......
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