Re: [Zope] Authentication Problem : External method returning object

2000-12-08 Thread Sean McGrath

 >> 
 >> Here is the external method "testexternal":
 >>
 >> class AClass:

[Dieter Maurer]
 >You will need (or something like this):
 >   __access_to_unprotected_subobjects__= 1
 >> def __init__(self):
 > >  

It works a treat. Thanks!

Sean


___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Authentication Problem : External method returning object : Zope 2.2.4

2000-12-07 Thread Tres Seaver

Sean McGrath <[EMAIL PROTECTED]> wrote:

> All,
> 
> I'm just a country boy raised on mashed potatoes and Zope 2.1.6.
> The new security model up here in the bright lights/big city world
> of Zope 2.2.4 has me all confused:-)
> 
> I have an external method that returns an object. I have a dtml method
> that tries to reference an attribute of that object. The attempted
> attribute reference causes the HTTP authenticate dialog to appear.
> No username/password seems to appease it.
> 
> Here is the relevant part of the DTML:
> 
> 
> 
> 
> Here is the external method "testexternal":

You need to tell Zope's security policy that untrusted code can read the
attributes of instances of AClass, like so:

> class AClass:

  __allow_access_to_unprotected_subobjects__ = 1

> def __init__(self):
> self.X = 1
> self.Y = 2
> 
> 
> def testexternal (self,REQUEST,RESPONSE):
> A = AClass()
> return A
> 
> Thanks in advance,
> Sean McGrath

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Authentication Problem : External method returning object :Zope 2.2.4Zope 2.2.4

2000-12-07 Thread Dieter Maurer

Hi Sean

Sean McGrath writes:
 > ...
 > I have an external method that returns an object. I have a dtml method
 > that tries to reference an attribute of that object. The attempted
 > attribute reference causes the HTTP authenticate dialog to appear.
 > No username/password seems to appease it.
Have you read Byan's "Upgrading to Zope 2.2"?

 > 
 > Here is the external method "testexternal":
 > 
 > class AClass:
You will need (or something like this):
__access_to_unprotected_subobjects__= 1
 >  def __init__(self):
 >  


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




[Zope] Authentication Problem : External method returning object :Zope 2.2.4 Zope 2.2.4

2000-12-07 Thread Sean McGrath

All,

I'm just a country boy raised on mashed potatoes and Zope 2.1.6.
The new security model up here in the bright lights/big city world
of Zope 2.2.4 has me all confused:-)

I have an external method that returns an object. I have a dtml method
that tries to reference an attribute of that object. The attempted
attribute reference causes the HTTP authenticate dialog to appear.
No username/password seems to appease it.

Here is the relevant part of the DTML:




Here is the external method "testexternal":

class AClass:
def __init__(self):
self.X = 1
self.Y = 2


def testexternal (self,REQUEST,RESPONSE):
A = AClass()
return A

Thanks in advance,
Sean McGrath


___
Zope maillist  -  [EMAIL PROTECTED]
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 )