Andreas Jung wrote:
What about the ZClasses?
Jim fixed them (hopefully :-))

They don't work for me in 2.8... :-(

I can't shake a new permission problem when trying to add a ZClass instance in 2.8b2. This is a 2.8 specific problem as the same process works in 2.7.6. For reference, the recently enabled tests for ZClasses all pass fine. This is a problem wether python or C security control is enabled via zope.conf. Also this was always tried with a 'fresh' ZODB.

From a bit of digging through the code it seems there is a difference comes about in the call on line 166 of AccessControl.User inside _check_context :

    return object.aq_inContextOf(context, 1)

In Zope 2.8 it returns 0, in 2.76 it returns 1 with the steps below. I don't know how to even start to try to debug inside this C based method?

Below are the steps I used to reproduce this problem. This was on a Fedora Core 3 x86_64 server with a fresh Zope & Python compile :

- Open the ZMI and login as a user with 'Manager' permissions.
- Goto : /Control_Panel/Products/
- Add a new Product 'AAA'
- Go to the Product : /Control_Panel/Products/AAA/
- Add a new 'Z Class' :
        meta type=ZZZ
        'Create Constructor objects' checked
        'Included standard Zope persistent object base classes' checked.

- Goto the Root Folder
- Goto the Security Tab
- Give 'Manager' permission to 'Add ZZZs'
- Goto the Root Folder
- Try to add an instance of a 'ZZZ':
        - Zope 2.7.6 succeeds no problem.
        - Zope 2.8.0-b2 (and b1) you get a http auth login form come up.
        - You get the same behaviours with Python 2.3.5 and 2.4.1.

I also tried a quick hack to make the above method always return 1 in Zope 2.8, but another error is then encountered whilst trying to add the ZClass instance :

    * Module ZPublisher.Publish, line 187, in publish_module_standard
    * Module ZPublisher.Publish, line 144, in publish
    * Module ZPublisher.Publish, line 107, in publish
    * Module Zope2.App.startup, line 248, in recordMetaData
    * Module OFS.Traversable, line 104, in getPhysicalPath
    * Module App.FactoryDispatcher, line 90, in __getattr__

AttributeError: getPhysicalPath

I didn't see anything different you 'need' to do with 2.8 WRT ZClasses for this to work, but I suppose I could have missed something! One other note is that I have also only been able to try this on 64 bit platforms (Solaris 10 and FC3 as above).

Thanks for any help.  I hope this can be resolved before 2.8 goes final!

Zope-Coders mailing list

Reply via email to