[Zope-CMF] Exposing the document owner's role
Norbert Marrale
norbert@attira.com
Fri, 10 Aug 2001 16:13:11 +0200
On 10 Aug 2001, at 13:45, Lucas Hofman wrote:
> This is a code fragment from my modified roster method, which lists (among
> some other attributes) the role(s) a user has:
>
[..]
> <dtml-in roster mapping size=bs orphan=1 start=qs>
> <dtml-let homeUrl="portal_membership.getHomeUrl(id, verifyPermission=1)"
> fullName="portal_membership.getFullName(id)"
> member="portal_membership.getMemberById(id)"
> email="member.email">
[..]
> <td>
> <dtml-var "_.string.join( portal_membership.getRoles(id), ',' )">
> </td>
Thanks Lucas, your snippet makes a lot of sense, except I somehow
can't get to the getFullName() and getRoles() attributes.
fullName="portal_membership.getFullName(id)"
Gives me an attribute error (see traceback), and so does
<dtml-var "_.string.join( portal_membership.getRoles(id), ',' )">
I assume nrLogins is your own customization of the logged_in skin and
a property of portal_memberdata?
Thanks for your help!
Norbert
<!--
Traceback (innermost last):
File N:\SandBox\lib\python\ZPublisher\Publish.py, line 223, in
publish_module
File N:\SandBox\lib\python\ZPublisher\Publish.py, line 187, in publish
File N:\SandBox\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
File N:\SandBox\lib\python\ZPublisher\Publish.py, line 171, in publish
File N:\SandBox\lib\python\ZPublisher\mapply.py, line 160, in mapply
(Object: roster)
File N:\SandBox\lib\python\ZPublisher\Publish.py, line 112, in
call_object
(Object: roster)
File N:\SandBox\lib\python\OFS\DTMLMethod.py, line 189, in __call__
(Object: roster)
File N:\SandBox\lib\python\DocumentTemplate\DT_String.py, line 540,
in __call__
(Object: roster)
File N:\SandBox\lib\python\DocumentTemplate\DT_Let.py, line 149, in
render
(Object: roster="portal_membership.getRoster()"
userMgr="portal_membership.checkPermission( 'Manage_users',
Members )")
File N:\SandBox\lib\python\DocumentTemplate\DT_In.py, line 633, in
renderwb
(Object: roster)
File N:\SandBox\lib\python\DocumentTemplate\DT_Let.py, line 148, in
render
(Object: homeUrl="portal_membership.getHomeUrl(id,
verifyPermission=1)"
fullName="portal_membership.getFullName(id)"
member="portal_membership.getMemberById(id)"
email="member.email")
File N:\SandBox\lib\python\DocumentTemplate\DT_Util.py, line 339, in
eval
(Object: portal_membership.getFullName(id))
(Info: portal_membership)
File <string>, line 0, in ?
File N:\SandBox\lib\python\DocumentTemplate\DT_Util.py, line 133, in
careful_getattr
AttributeError: (see above)
-->
On the Road of Life,
there are Tourists and there are Travelers.
I'd rather be Traveling!
Norbert Marrale
norbert@infocatch.com