[Zope-CMF] Breadcrumbs over something that user does not have access to

Heimo Laukkanen huima@fountainpark.org
Sun, 05 May 2002 16:13:39 +0300


Hi all,

here is a small problem that I stumbled into and was wondering if=20
there was a better way to solve it.

I'm creating a service with CMF 1.3beta1 for anonymous and registered=20
users. There are also folders, in which only some of the members have=20
access to with role ExtraMember. Access is given in local roles.

First I created a top folder for these ExtraMember-folders, in which I=20
set that only ExtraMembers can access that folder. And on folders=20
inside ExtraMembers I give local roles to wanted users.

So the structure can be following

    root
      +
      +-- members-only-dir
         +
         +-- dir for only ExtraMember
            +
            +-- groupDir
            +-- groupDir 2


Now breadcrumbs give me trouble, since it can=E4t access the=20
ExtraMember-folder. I solved it by using proxy role and checking=20
permission 'View' before adding the folder to breadcrumbs.

Clip from Breadcrumbs:
----------------------
relative =3D context.portal_url.getRelativeContentPath( context )
portal =3D context.portal_url.getPortalObject()

for i in range( len( relative ) ):
     now =3D relative[ :i+1 ]

     obj =3D portal.restrictedTraverse( now )
     if (context.portal_membership.checkPermission('View', obj)):

-----------------------

Now I was wondering if I could have done it in some other way without=20
Proxy role?



-huima