[ZCM] [ZC] 270/ 2 Comment "Inheriting security decl. with "manage.*" names in Python Products"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Tue, 17 Jun 2003 16:30:29 -0400


Issue #270 Update (Comment) "Inheriting security decl. with "manage.*" names in Python Products"
 Status Pending, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/270

==============================================================
= Comment - Entry #2 by leper on Jun 17, 2003 4:30 pm

Methods that start with 'manage' are automatically restricted to users with the Manager role, this is old-school magic, and from the sounds of it, it clobbers inheritance.
________________________________________
= Request - Entry #1 by Anonymous User on Mar 6, 2002 10:31 am

I dont seem to be able to inherit security declarations for names beginning with "manage", see the test product attached (oops attachment doesnt work, ill add the relevant bits below).

default__class_init (in App/class_init.py), ca. line 119 seems to hint that names beginning with "manage" are treated differently

If this is intended behaviour I think it should be documented in the DevGuide, under "Inheritance And Class Security Declarations" (is it documented somewhere?)

For example:

>class testBaseClass( Folder.Folder ):
>	""" Base class with security declarations
>	"""
>	security = ClassSecurityInfo()
>	security.declareProtected('TestProtection', 'manage_test')
>	security.declareProtected('TestProtection', 'test')
>	def test(self):
>	 	" "
>	def manage_test(self):
>	 	" "
>	
>InitializeClass(testBaseClass)
>
>
>
>class testProduct( testBaseClass ):
>	"""I'd like to inherit testBaseClass security declarations
>	but this works only with the test() method
>
>	I can only access manage_test() if I've got Manager privileges
>	"""
>
>	meta_type = 'testProduct'
>
>	def test(self):
>		"""
>		"""
>		s = "__ac_permissions__: %s " % (self.__ac_permissions__,)
>		return s
>
>	def manage_test(self):
>		"""
>		"""
>		s = "__ac_permissions__: %s " % (self.__ac_permissions__,)
>		return s
>
>InitializeClass(testProduct)


==============================================================