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

Casey Duncan casey@zope.com
Thu, 15 Aug 2002 13:34:15 -0400


I suspect you have not made any security assertions on your class.

see:=20

http://www.zope.org/Documentation/Books/ZDG/current/Security.stx

hth,

-Casey

On Thursday 15 August 2002 10:12 am, Tim Hicks wrote:
> I have a XronDTMLMethod with the following body:
>=20
> ----
> <dtml-let zoffice=3D"superValues(['ZOffice Converter'])[0]">
> <dtml-call
> "zoffice.getConverterByName('AsyncZlaveClient').fireNextConversion(_)">
> </dtml-let>
> ----
>=20
> So, it finds the nearest 'ZOffice Converter' instance (in the acquisiti=
on
> chain), names it 'zoffice', then attempts to do the call in the middle =
line.
>=20
> My ZOffice class has the following method defined:
>=20
> ----
> def getConverterByName(self, converterName):
>     """ """
>     return self._pluginConverters[converterName].__of__(self)
> ----
>=20
> self._pluginConverters is a class level dictionary with keys of convert=
er
> names and values of converter instances.  The converter instances inher=
it
> from Acquisition.Implicit.
>=20
> However, when I 'Trigger' the XronDTMLMethod, I get the following error=
:
>=20
> ----
> Traceback (most recent call last):
>=20
>   File "D:\Zlave\zope251\lib\python\Products\Xron\XronDTMLMethod.py", l=
ine
> 141, in trigger
>     REQUEST=3DREQUEST, RESPONSE=3DRESPONSE, kw=3Dkw)
>=20
>   File "D:\Zlave\zope251\lib\python\OFS\DTMLMethod.py", line 127, in
> __call__
>     r=3Dapply(HTML.__call__, (self, client, REQUEST), kw)
>=20
>   File "D:\Zlave\zope251\lib\python\DocumentTemplate\DT_String.py", lin=
e
> 473, in __call__
>     try: result =3D render_blocks(self._v_blocks, md)
>=20
>   File "D:\Zlave\zope251\lib\python\DocumentTemplate\DT_Let.py", line 7=
6, in
> render
>     return render_blocks(self.section, md)
>=20
>   File "D:\Zlave\zope251\lib\python\DocumentTemplate\DT_Util.py", line =
159,
> in eval
>     return eval(code, d)
>=20
>   File "<string>", line 2, in f
>=20
>   File "D:\Zlave\zope251\lib\python\AccessControl\DTML.py", line 29, in
> guarded_getattr
>     return guarded_getattr(*args)
>=20
>   File "D:\Zlave\zope251\lib\python\AccessControl\ZopeGuards.py", line =
58,
> in guarded_getattr
>     return inst.aq_acquire(name, aq_validate, validate)
>=20
>   File "D:\Zlave\zope251\lib\python\AccessControl\ZopeGuards.py", line =
40,
> in aq_validate
>     return validate(inst, obj, name, v)
>=20
>   File "D:\Zlave\zope251\lib\python\AccessControl\SecurityManager.py", =
line
> 83, in validate
>     self._context)
>=20
>   File "D:\Zlave\zope251\lib\python\AccessControl\ZopeSecurityPolicy.py=
",
> line 145, in validate
>     raise Unauthorized(name, value)
>=20
> Unauthorized: You are not allowed to access fireNextConversion in this
> context
> ----
>=20
> So, my question; why can't I call this method of my converter object?
>=20
>=20
> cheers,
>=20
> tim
>=20
>=20
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>=20