[Zope-dev] several permissions for the same method

Chris Withers chrisw@nipltd.com
Thu, 20 Jul 2000 23:18:50 +0100


Jephte CLAIN wrote:

<snip different security for same method>

You could just check for the permissions specifically, here's a quote
from Folder.py in Zope 2.2:

> checkPermission=getSecurityManager().checkPermission    
> 
> if createUserF:
> if not checkPermission('Add User Folders', ob):
>     raise 'Unauthorized', (
>           'You are not authorized to add User Folders.'
>           )
> ob.manage_addUserFolder()
> 
> if createPublic:
> if not checkPermission('Add Documents, Images, and Files', ob):
>     raise 'Unauthorized', (
>           'You are not authorized to add DTML Documents.'
>           )
> ob.manage_addDTMLDocument(id='index_html', title='')
> 
> if REQUEST is not None:
> return self.manage_main(self, REQUEST, update_menu=1)

Any help?

cheers,

Chris