Well, it's gotten worse.
I've been trying to narrow this down, and so far, haven't come up with
anything promising. I'm now using the built in principal folder, and
the associated principals, not ones of my own. My current failing test
case boils down to:
from zope.interface import Interface
from zope.schema import TextLine
from zope.app.annotation.interfaces import IAnnotatable
text_content = TextLine(
title = u"Text Content",
description = u"Some Text Content for testing")
"""An object that can contain some content"""
menu="zmi_views" title="Some Content"
from zope.interface import implements
from interfaces import ISomeContent
KEY = "somecontent.perm_tests"
text_content = u"apple"
def __init__(self, context):
self.context = context
So there's the code, if I change myproject.View to zope.View,
everything works. I can grant myproject.View on the object itself, to
the appropriate principal, and I will get an Unauthorized error. Yet
if I change it to zope.View, it works.
On 9/16/05, Alec Munro <[EMAIL PROTECTED]> wrote:
> Hi All,
> I have created my own principal source, as a bare derivative of
> My principals can log in, and are generally effective.
> However, there seems to be some lacking to them. Whenever I access any
> of a certain bunch of annotation adapters, I get a silent abort. That
> is, it prints abort on the command line, but no more information. My
> own personal experience is that these tend to be permission errors, so
> I assume it is something like that.
> What is especially odd is that I can assign the required permission to
> zope.anybody, and I am able to access the adapters. Doing a heavy
> sequence of print-based debugging, I found out that the error seems to
> occur during a sequence of calls to my adapters __getattr__ method.
> This method, in the case of my adapters, looks up the key in a
> mapping, and raises an attribute error if it is not there. In each
> case, the error occurs after it looks for a number of keys that aren't
> there, a long sequence of "__parent__", and "__conform__". These occur
> when I attempt to access a property of the adapter (any property).
> They also occur even when it works, such as if I'm using zope.anybody,
> so I don't think it is the calls themself that are causing there
> My impression is that the calls are related to zopes security
> machinery, and that for some reason they end up being executed in a
> place where they are unable to find the correct principal.
> I'm sure you need more information, but I'm not sure what would be helpful.
> Alec Munro
Zope3-dev mailing list