Re: [Zope] all_meta_types confusion

2007-01-09 Thread Garth B.

Hello Dieter,

This is my all_meta_types function:

def all_meta_types(self):
   return (
   {
   'name' : 'Web Page',
   'action': 'manage_addProduct/DWT/WebPage_add',
   'permission': 'Add Web Page',
   },
   )

I haven't followed Maciej's suggestion yet to use pdb to more closely trace
what's going on, but if you have suggestions on what *might* be going on to
help me in my debugging, that would be great.

Thank you,
Garth

On 1/7/07, Dieter Maurer [EMAIL PROTECTED] wrote:



 You have included the 'permission' definition in your meta_type
entry?

Garth B. wrote at 2007-1-5 23:06 -0500:

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 x 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 x button that one would normally
see
when only able to add a single type of object to a folderish object.

--
Dieter

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


Re: [Zope] all_meta_types confusion

2007-01-09 Thread Dieter Maurer
Garth B. wrote at 2007-1-9 10:57 -0500:
def all_meta_types(self):
return (
{
'name' : 'Web Page',
'action': 'manage_addProduct/DWT/WebPage_add',
'permission': 'Add Web Page',
},
)

I haven't followed Maciej's suggestion yet to use pdb to more closely trace
what's going on, but if you have suggestions on what *might* be going on to
help me in my debugging, that would be great.

This looks good. It should work. If not, the debugging suggestions
is probably the most effective.



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


Re: [Zope] all_meta_types confusion

2007-01-09 Thread Gabriel Genellina

At Tuesday 9/1/2007 12:57, Garth B. wrote:


def all_meta_types(self):
return (
{
'name' : 'Web Page',
'action': 'manage_addProduct/DWT/WebPage_add',
'permission': 'Add Web Page',
},
)


Make sure you use *exactly* the same string to define permissions 
everywhere; better use a global name.



--
Gabriel Genellina
Softlab SRL 







__ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] all_meta_types confusion

2007-01-07 Thread Dieter Maurer
Garth B. wrote at 2007-1-5 23:06 -0500:
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 x 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 x button that one would normally see
when only able to add a single type of object to a folderish object.

You have included the 'permission' definition in your meta_type entry?



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


Re: [Zope] all_meta_types confusion

2007-01-06 Thread Maciej Wisniowski
 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.
I don't know the answer but you might want to use pdb to see what
happens in the code that confuses you.

If you don't know how to use pdb see:
http://plone.org/documentation/how-to/using-pdb

HTH

-- 
Maciej Wisniowski
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] all_meta_types confusion

2007-01-05 Thread Garth B.

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 x 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 x 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,
Garth
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )