[ZCM] [ZC] 270/ 1 Request "Inheriting security decl. with "manage.*" names in Python Products"
Collector: Zope Bugs and Patches ...
zope-coders@zope.org
Wed, 06 Mar 2002 10:31:23 -0500
Issue #270 Update (Request) "Inheriting security decl. with "manage.*" names in Python Products"
Status Pending, Zope/bug medium
To followup, visit:
http://collector.zope.org/Zope/270
==============================================================
= 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)
==============================================================