Re: [Zope] inserting half a dtml tag into a zclass

2001-01-10 Thread Dieter Maurer

Tim Hicks writes:
 > >  II. I think (this implies, I am not sure), that ZPublisher
 > >  translates exceptions into HTTP response codes.
 > >  This would mean, you could try:
 > >
 > >In your "privacy" method:
 > >   
 > >   
 > >   
 > >   
 > >
 > >in your other objects:
 > >
 > >   
 > >   ...header...
 > >   
 > >   ...footer...
 > >
 > 
 > You've lost me a bit there.  Where am I actually checking to see if the user
 > has access rights?
When I use "", this means something
you have provided or will fill in with application specific code.

Thus, in your privacy method:

     
  
  
  


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 )




Re: [Zope] inserting half a dtml tag into a zclass

2001-01-10 Thread Tim Hicks


- Original Message -
From: Dieter Maurer <[EMAIL PROTECTED]>
To: Tim Hicks <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, December 29, 2000 9:38 AM
Subject: Re: [Zope] inserting half a dtml tag into a zclass


> Tim Hicks writes:
>  > This is a multi-part message in MIME format.
>  >
>  > --=_NextPart_000_0009_01C07071.533E96C0
>  > Content-Type: text/plain;
>  > charset="iso-8859-1"
>  > Content-Transfer-Encoding: quoted-printable
> You are here long enough: you should know, we do not like MIME
> messages.

My apologies. You're right, I do know better... my mistake.  Also, apologies
for the delayed reply, I've been away.

>
>  > ... isolating privacy checks ...
>  > 
>  > 
>  > 
>  > 
>
> I know about 2 possible approaches:
>
>  I. let your "privacy" method return a value (using "dtml-return")
> and check it above:
>
> 
>   ...header...
>   ...
>   ...footer...
> 
>

I've gone for a 'method' based on this first idea of yours.  Here is what
appears in each zclass instance.










And here is the privacy method.




















It's not perfect (that would be when there is nothing for the user to break
in each instance), but it's better than it was and also allows me to edit
only one privacy method to change the access rights.


>  II. I think (this implies, I am not sure), that ZPublisher
>  translates exceptions into HTTP response codes.
>  This would mean, you could try:
>
>In your "privacy" method:
>   
>   
>   
>   
>
>in your other objects:
>
>   
>   ...header...
>   
>   ...footer...
>

You've lost me a bit there.  Where am I actually checking to see if the user
has access rights?

Cheers

tim


___
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] inserting half a dtml tag into a zclass

2000-12-29 Thread Dieter Maurer

Tim Hicks writes:
 > This is a multi-part message in MIME format.
 > 
 > --=_NextPart_000_0009_01C07071.533E96C0
 > Content-Type: text/plain;
 >  charset="iso-8859-1"
 > Content-Transfer-Encoding: quoted-printable
You are here long enough: you should know, we do not like MIME
messages.

 > ... isolating privacy checks ...
 > 
 > 
 > 
 > 

I know about 2 possible approaches:

 I. let your "privacy" method return a value (using "dtml-return")
and check it above:


  ...header...
  ...
  ...footer...


 II. I think (this implies, I am not sure), that ZPublisher
 translates exceptions into HTTP response codes.
 This would mean, you could try:

   In your "privacy" method:
  
  
  
  

   in your other objects:

  
  ...header...
  
  ...footer...


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] inserting half a dtml tag into a zclass

2000-12-27 Thread Tim Hicks



OK, I'm sorry for the wierd title, but I can't 
really describe what I want to say very easily in one line.
 
Basically, my problem is this;
 
- I have a zclass called DEHS with catalog_aware 
and dtml_document as base classes.
- DEHS instances have a selectable property of 
public/private.
- I want to be able to make it so that if the 
property is set to 'private', then only people on a particular network may 
access it. So, here is what I have done (and it works),
 

 

 

 

 
 
 

 
So, what's the problem I hear you ask.  Well, 
I don't really want all this code to be visible (or breakable) in every DEHS 
instance. What I would really like to do is have this,
 

 

 

 

 
where,  is just all of the 
code that I have above s_h_h. However, zope will not let me do this because 
I end up with a  that is missing its closing tag, and 
one that does not have an opening tag. I realise that I there are products 
already designed with the sort of functionality I am after built in, but I will 
not have much influence on the products that will be available on the server 
that this site will end up on... which is why I'm doing it in this 
way.
 
Any input is much appreciated.
 
cheers
 
tim