[Zope] changing permissions on classes/methods at runtime?

Lennart Regebro regebro at gmail.com
Tue Mar 6 08:02:33 UTC 2012


On Mon, Mar 5, 2012 at 19:22, Sean Upton <sdupton at gmail.com> wrote:
> On Wed, Feb 29, 2012 at 7:12 AM, Jürgen Herrmann
> <Juergen.Herrmann at xlhost.de> wrote:
>> 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:
>
> I don't off-hand know why just monkey-patching the security attribute
> of your class and then calling InitializeClass() again would not work,
> but the idea of changing these at runtime after initial zope startup
> sounds a bit odd, possibly dangerous.  What is it that you are trying
> to do?

When I needed this to be dynamic I simply did not have any security
declaration and instead tested the permissions the first thing I did
in the method. That worked fine. It is however probably ten years ago,
and I don't remember or have the code. But it was quite simple, I
think.

//Lennart


More information about the Zope mailing list