Hey everyone,

Zope 2.9.6

I'm trying to filter the objects that appear in the Add drop down, and I'm
having odd results.  There are two scenarios.

In the first scenario, the active user is a Manager and my folderish object
does not have a defined all_meta_types function.  Everything shows up in the
Add drop down as expected.  When I define all_meta_types for my folderish
object to only return one kind of object, the "Add xxxxx" button appears as
one would expect.

In the second scenario, I have a role "Editor" which controls what kinds of
objects the user can add.  When I do not have an all_meta_types function
defined on my folderish object, only those objects that the role permits the
user to add are shown.  When I define all_meta_types for my folderish object
to only return one of the kinds of objects that the role does permit, the
user can't add anything.  No "Add xxxxx" button that one would normally see
when only able to add a single type of object to a folderish object.

For the same type of object, and when logged in as an "Editor", the call to
user.has_permission() (around line 254) in filtered_meta_types() in
ObjectManager.py, returns false when all_meta_types is defined, and returns
true when it isn't.  I don't know why the user would not have permission to
add this type of object when all_meta_types is defined versus when it
isn't.  This is why I'm confused.

No errors or exceptions.

So, in summary, when I don't have all_meta_types defined for my folderish
object, the five types of objects the role is permitted to add is shown in
the Add drop down.  When I set all_meta_types to only permit one of those
five types of objects to be added, the user can't add anything.  A user with
the Manager role doesn't appear to have this problem.

Any suggestions for what's going on here?  Any insights are appreciated!

Thank you,
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to