changing permissions on classes/methods at runti me?

Jürgen Herrmann <[email protected]>
Newsgroups gmane.comp.web.zope.general
Organization XLhost.de GmbH
Message-ID <[email protected]>
hi all!

is it possible to change permissions and roles on classes/methods
at runtime? normally you'd attach security declarations inline in
your class definition code:

from AccessControl import ClassSecurityInfo
from AccessControl.class_init import InitializeClass
class Cls():
   security = ClassSecurityInfo()
   security.declarePrivate('foo')
   def foo(self):
     pass
InitializeClass(Cls)


now what i tried at runtime is:

from mycode import Cls
from AccessControl import ClassSecurityInfo
security = ClassSecurityInfo()
security.declarePublic('foo')
security.apply(Cls)

but this does not what i want it to, in fact it doesn't seem
to do anything yet - probably because i'm using the wrong way :)

any hints how to do this correctly would be greatly appreciated.

thank you very much in advance and best regards,
Jürgen Herrmann
-- 
>> XLhost.de ® - Webhosting von supersmall bis eXtra Large <<

XLhost.de GmbH
Jürgen Herrmann, Geschäftsführer
Boelckestrasse 21, 93051 Regensburg, Germany

Geschäftsführer: Jürgen Herrmann
Registriert unter: HRB9918
Umsatzsteuer-Identifikationsnummer: DE245931218

Fon:  +49 (0)800 XLHOSTDE [0800 95467833]
Fax:  +49 (0)800 95467830
Web:  http://www.XLhost.de
_______________________________________________
Zope maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.