Prevent non-Managers From /manage
Submitted by: runyaga
Last Edited: 2004-10-14
Category: CMF
|
| Average rating is:
0.0 out of 5
|
(0 ratings) |
|
Description:
by default Member users can access /manage or /manage_main in
a CMF site. (for folders they own). if you feel uncomfortable
about this here is a quick recipe that will restrict access to the
ZMI for non-Manager users.
|
Source (Text):
REQUEST=context.REQUEST
RESPONSE=REQUEST.RESPONSE
urlUnauthorized = context.portal_url()
member = context.portal_membership.getAuthenticatedMember()
path_info = REQUEST['PATH_INFO'].split('/')
if ( 'manage' in path_info or \
'manage_main' in path_info ) and \
'Manager' not in member.getRoles():
return RESPONSE.redirect(urlUnauthorized+'?portal_status_message=Not%20Allowed.')
|
Explanation:
I think in most production systems you would control this at the proxy level,
and url rewriting. You wouldnt allow /manage or /manage_main to be used. But
some people are finding ZServer works just fine for them. This recipe is
mainly for them.
|
Comments:
No Comments
|