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

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


-----BEGIN PGP SIGNED MESSAGE-----
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:

 [security]
 View = 0:Manager

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


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

iD8DBQFC8OVK+gerLs4ltQ4RAkLyAJ0V3MGg0Vq5wd5Dsz6v7LpRIdFhgACfQihx
BAJF8cTx890GdYKxvFgrc+Q=
=BYMu
-----END PGP SIGNATURE-----



More information about the Zope-Dev mailing list