[Zope-dev] security.declareProtected doesn't always work?

Martijn Faassen faassen@vet.uu.nl
Fri, 4 Jan 2002 13:23:50 +0100


Dieter Maurer wrote:
[snip]
>  > Now replace the line "security.declarePublic('getTitle')" with something like
>  > "security.declareProtected('View', 'getTitle')", and suddenly nobody is
>  > allowed to call getTitle() on a Book object anymore.
> You must acquistion wrap your book objects. Otherwise, Zope's
> security code is unable to find the permission-role mapping.
> 
> Try:
> 
> 	return books.__of__(self)

Aah, of course, makes sense. They should put this in the developer's guide!
The thing that tripped me up is that it works at all for declarePublic. :)

Thanks,

Martijn