[Zope-dev] manage_access problems

Leonardo Rochael Almeida leo@hiper.com.br
Thu, 30 Aug 2001 11:42:28 -0300


On Thu, Aug 30, 2001 at 07:33:23AM -0700, Zopista wrote:
> > But I can't access in this object if I want 'Reviewer' ???  it isn't  a
> list
> > or a string because I canp't use
> 
> No its a dictionary, have a look at the python documentation to understand
> what a dict is.
> 
> http://www.python.org/doc/current/tut/node7.html#SECTION00740000000000000000
> 0
> 
> Since this is a complicated data structure, you should really be using a
> Python script. However if what you are trying to do is who has the Access
> Contents Information role, this will work:
> 
> <dtml-in "folderEditing.rolesOfPermission('Access contents information')">
>   <dtml-if "_['sequence-item']['selected']=='SELECTED'">
>     <dtml-var "_['sequence-item']['name']">
>   </dtml-if>
> </dtml-in>

Alternativelly, you could use (note that I didn't test it)

<dtml-in "folderEditing.rolesOfPermission('Access contents information')" mapping>
  <dtml-if "selected == 'SELECTED'"
    <dtml-var name>
  </dtml-if>
</dtml-in>

the 'mapping' attribute of dtml-in assumes sequence-key to be a mapping
(i.e. a dictionary) and pushes the key-value pairs onto the namespace.

    Regards, Leo