[Zope] Can't access a method 'in this context'

Casey Duncan casey@zope.com
Thu, 15 Aug 2002 14:04:41 -0400


What are the base classes of your class? Perhaps it is not traversable. T=
ry=20
subclassing OFS.SimpleItem.SimpleItem (unless you subclass something=20
equivilant already)

-Casey

On Thursday 15 August 2002 01:54 pm, Tim Hicks wrote:
> > I suspect you have not made any security assertions on your class.
>=20
> Casey,
>=20
> you were partly right... I had copied and pasted a very similar method =
(and
> it's security) but only remembered to change the actual method definiti=
on
> and not the security.
>=20
> *However*, correcting this mistake seems to have made no difference at =
all.
> I still receive exactly the same error message and traceback.  To be su=
re, I
> deleted my product from the Control Panel (along with all instances),
> restarted Zope (2.5.1 btw) and then tested again... no joy though :-(
>=20
> Any more clues?  I've got to say, 'context' and acquisition type stuff =
(if
> that's even relevant here) are pretty mysterious to me.
>=20
> cheers
>=20
> tim
>=20
>=20
> > On Thursday 15 August 2002 10:12 am, Tim Hicks wrote:
> > > I have a XronDTMLMethod with the following body:
> > >
> > > ----
> > > <dtml-let zoffice=3D"superValues(['ZOffice Converter'])[0]">
> > > <dtml-call
> > > "zoffice.getConverterByName('AsyncZlaveClient').fireNextConversion(=
_)">
> > > </dtml-let>
> > > ----
> > >
> > > So, it finds the nearest 'ZOffice Converter' instance (in the
> acquisition
> > > chain), names it 'zoffice', then attempts to do the call in the mid=
dle
> line.
> > >
> > > My ZOffice class has the following method defined:
> > >
> > > ----
> > > def getConverterByName(self, converterName):
> > >     """ """
> > >     return self._pluginConverters[converterName].__of__(self)
> > > ----
> > >
> > > self._pluginConverters is a class level dictionary with keys of
> converter
> > > names and values of converter instances.  The converter instances
> inherit
> > > from Acquisition.Implicit.
> > >
> > > However, when I 'Trigger' the XronDTMLMethod, I get the following e=
rror:
> > >
> > > ----
> > > Traceback (most recent call last):
> > >
> > >   File "D:\Zlave\zope251\lib\python\Products\Xron\XronDTMLMethod.py=
",
> line
> > > 141, in trigger
> > >     REQUEST=3DREQUEST, RESPONSE=3DRESPONSE, kw=3Dkw)
> > >
> > >   File "D:\Zlave\zope251\lib\python\OFS\DTMLMethod.py", line 127, i=
n
> > > __call__
> > >     r=3Dapply(HTML.__call__, (self, client, REQUEST), kw)
> > >
> > >   File "D:\Zlave\zope251\lib\python\DocumentTemplate\DT_String.py",=
 line
> > > 473, in __call__
> > >     try: result =3D render_blocks(self._v_blocks, md)
> > >
> > >   File "D:\Zlave\zope251\lib\python\DocumentTemplate\DT_Let.py", li=
ne
> 76, in
> > > render
> > >     return render_blocks(self.section, md)
> > >
> > >   File "D:\Zlave\zope251\lib\python\DocumentTemplate\DT_Util.py", l=
ine
> 159,
> > > in eval
> > >     return eval(code, d)
> > >
> > >   File "<string>", line 2, in f
> > >
> > >   File "D:\Zlave\zope251\lib\python\AccessControl\DTML.py", line 29=
, in
> > > guarded_getattr
> > >     return guarded_getattr(*args)
> > >
> > >   File "D:\Zlave\zope251\lib\python\AccessControl\ZopeGuards.py", l=
ine
> 58,
> > > in guarded_getattr
> > >     return inst.aq_acquire(name, aq_validate, validate)
> > >
> > >   File "D:\Zlave\zope251\lib\python\AccessControl\ZopeGuards.py", l=
ine
> 40,
> > > in aq_validate
> > >     return validate(inst, obj, name, v)
> > >
> > >   File "D:\Zlave\zope251\lib\python\AccessControl\SecurityManager.p=
y",
> line
> > > 83, in validate
> > >     self._context)
> > >
> > >   File
> "D:\Zlave\zope251\lib\python\AccessControl\ZopeSecurityPolicy.py",
> > > line 145, in validate
> > >     raise Unauthorized(name, value)
> > >
> > > Unauthorized: You are not allowed to access fireNextConversion in t=
his
> > > context
> > > ----
> > >
> > > So, my question; why can't I call this method of my converter objec=
t?
> > >
> > >
> > > cheers,
> > >
> > > tim
> > >
> > >
> > > _______________________________________________
> > > Zope maillist  -  Zope@zope.org
> > > http://lists.zope.org/mailman/listinfo/zope
> > > **   No cross posts or HTML encoding!  **
> > > (Related lists -
> > >  http://lists.zope.org/mailman/listinfo/zope-announce
> > >  http://lists.zope.org/mailman/listinfo/zope-dev )
> > >
> >
>=20
>=20