[Zope-dev] Re: File System Directory Files Permission Setting

Tres Seaver tseaver at palladion.com
Wed Aug 3 11:39:54 EDT 2005

Hash: SHA1

Evrim Ozcelik wrote:
> Is there a way to set zope permissions for files that are linked to zope 
> with file system directory view. For example, i have a zope python script 
> which must only be executed by users that have manager role. In order to do 
> this i think i have 2 alternatives:
> 1- I can control the permission in the zope python script script
> user = getAuthenticatedUser() 
> if(user has manager role):
> ....
> else:
> go to login
> 2- I can put a special file like .metadata file and set the python script 
> zope permissions. (I don't know how can i do this)

First, FSPythonScript, DirectoryView, etc. are from CMFCore -- the more
appropriate list for this question would be zope-cmf at zope.org (CC'ed).

Second:  the .metadata file allows you to change a number of settings
for filesystem-based objects, including title, cache manager, proxy
roles, and the role permission map.  In your case, the map is the
important setting:  you want to restrict the "View" permission to the
"Manager" role, e.g:

 View = 0:Manager

Where the '0:' bit turns off the "Acquire?" flag.

- --
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


More information about the Zope-Dev mailing list