Re: Security internals, was Re: [Zope-dev] LOTS of roles?

2003-03-07 Thread Jens Vagelpohl
hm... i could have told you that the LDAPUser class in the 
LDAPUserFolder product can do that but i had the whole thread mostly 
tuned out. initially it did not look like anything i could help with 
and the first posting was very long if i remember correctly.

jens

On Thursday, Mar 6, 2003, at 17:13 US/Eastern, Paul Winkler wrote:

On Fri, Mar 07, 2003 at 08:56:59AM +1100, Adrian van den Dries wrote:
(/me revisits LDAPUserFolder)

Looks like the work is already done for you anyway: allowed() and
friends check if the context has an attribute acl_satellite, and
queries it for any additional roles, and it even keeps a cache.


!!  OMG !!!

thank you - for some obscure reason it never would have occurred to
me in a million years that LDAPUserFolder already does this.
Well, duh.
Huzzah open-source software!
Amen!

--

Paul Winkler


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ZODB: Are all handles closed?

2003-03-07 Thread Ulla Theiss
Hello list,

in our product (and additionally in an other process) we use separate
ZODB-Storages.

Opening and closing the ZODB several times the number of file-handles
increases.

We have separated the multiple openings and closings to the following
code.
It shows the increasing of the handles clearly.

Have we forgotten to clear anything or made anything wrong? 
If not, has anybody an idea, how to fix or work around the problem.

--snip--snap-
from ZODB import FileStorage, DB

for i in range (1,100):
storage=FileStorage.FileStorage(TestZODB.fs)
db = DB(storage)
db.open()
print Open
db.close()
print Close
storage.close()
--snip--snap-

Enother nice behaviour we can achieve with the following code:

--snip--snap-
from ZODB import FileStorage, DB

storage=FileStorage.FileStorage(TestZODB.fs)
db = DB(storage)

for i in range (1,100):
db.open()
print Open
db.close()
print Close
storage.close()
--snip--snap-

It works about seven times. Then the programm hangs completely.

Much thanks in advance,
Ulla.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZODB: Are all handles closed?

2003-03-07 Thread Steve Alexander
Ulla Theiss wrote:
Hello list,

in our product (and additionally in an other process) we use separate
ZODB-Storages.
Opening and closing the ZODB several times the number of file-handles
increases.
You might want to post this to [EMAIL PROTECTED] instead of 
[EMAIL PROTECTED]

Also, be sure to say what version of python and zodb you are using.

--
Steve Alexander


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] implementing structured text alternative w/in Zope

2003-03-07 Thread Toby Bologna
Hi,

I'm a programmer but new to Zope. I'm developing a text markup language
like Structured Text that better suits my needs outside the Zope/Python
world. Would I be able to incorporate it within Zope, i.e., so I could
edit the new format in the edit window and have it displayed as HTML by
the server, handled as a Zope object, etc.?

I'd like to do it as transparently as (on the lowest level) possible,
but if it turns out I have to do it as a feature of a product, that
will be OK. Any tips for either scenario much appreciated.

Thanks in advance,

--tb


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: [Vote] PEP308 voting began

2003-03-07 Thread Paul Winkler
On Fri, Mar 07, 2003 at 07:33:44AM +0100, Joachim Werner wrote:
 If I understood the intentions of ZPT right one of the ideas was to get 
 rid of too much application logic in the template. But currently ZPT 
 seems to be extended to become very similiar in functionality to DTML. 
 I'd prefer to see an approach where Python is used wherever it makes 
 sense and ZPT is kept as simple and stupid as possible.


+sys.maxint

ugly python expressions in ZPT is to me a clear signal that
you need to refactor and that's a GOOD THING.  And refactoring
is easy when you can just start by copy / pasting the
python expressions into a Script.  If they were some
new-fangled if: then: else: syntax in TAL, you'd have to
rewrite from scratch...  and we're right back in the
mess we got into with DTML: the poor developer is forced
to learn many ways of doing the same thing.


-- 

Paul Winkler
http://www.slinkp.com
look! up in the sky! it's secretary The Archer of Doom
(randomhero courtesy isometric.spaceninja.com)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] umount/remount

2003-03-07 Thread Florent Guillaume
Is there any way to unmount then remount a mounted storage from a
running Zope?

Use case: mounting it read-only most of the time, and switching to
read-write at selected points when updates are allowed.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:[EMAIL PROTECTED]


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: [Vote] PEP308 voting began

2003-03-07 Thread Lennart Regebro
Steve Alexander wrote:

 This is possible. But, the problem remains that both a and b (in your 
 example above) are evaluated.

I don't see the problem with that, unless a or b actually do stuff, and 
modify stuff, and if it does, in ZPT it should then be put into a 
script, since the template itself shouldn't contain any business logic.

I can see the use of a one-line if-else syntax in ZPT as a way to set an 
attribute without making a specific pythons script just for such a small 
 piece of code, and this will do it.

If you want to *DO* different stuff depending on a condition, that 
shouldn't be in the template.

Also, Evan tells me that this already exists in python: expressions, and 
is called test(). So, problem solved, no additional uglyfication of 
Python is needed. :)



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] implementing structured text alternative w/in Zope

2003-03-07 Thread Joachim Werner
Toby Bologna schrieb:
Hi,

I'm a programmer but new to Zope. I'm developing a text markup language
like Structured Text that better suits my needs outside the Zope/Python
world. Would I be able to incorporate it within Zope, i.e., so I could
edit the new format in the edit window and have it displayed as HTML by
the server, handled as a Zope object, etc.?
I'd like to do it as transparently as (on the lowest level) possible,
but if it turns out I have to do it as a feature of a product, that
will be OK. Any tips for either scenario much appreciated.
Of course you can do that with Zope. You'll find quite a few examples of 
new markup languages for Zope if you browse the Products list on zope.org.

You definitely will have to write a product for this.

You need a basic method or document object (like DTMLMethod). Writing or 
adapting the over-the-web edit screens is simple. The harder part will 
be the parser that generates the HTML for you. But I guess you know how 
to do this.

There is one thing that might be trickier than you'd expect: If you want 
to have the same security features as in DTML or ZPT (i.e. checking for 
every method call and attribute if the viewer has the permissions to 
execute/view them) you will have to implement much of that on your own 
in the language parser.

Note that if you keep it as simple as structured text you won't need to 
care about the security issue. In structured text you don't call other 
code or attributes ...

The document object will have to implement a __call__() (or 
index_html()) method for it. This method has to take the code (that is 
stored in a property of the object) and render it. Then you just 
return the result at the end. It's really not that difficult, and if 
you take a similar product and look at the code it is relatively easy to 
understand.

Be sure that you read the Zope Developers Guide on zope.org first!

Joachim

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] implementing structured text alternative w/in Zope

2003-03-07 Thread Andreas Jung


--On Freitag, 7. März 2003 19:20 +0100 Joachim Werner [EMAIL PROTECTED] wrote:

Toby Bologna schrieb:
Hi,

I'm a programmer but new to Zope. I'm developing a text markup language
like Structured Text that better suits my needs outside the Zope/Python
world. Would I be able to incorporate it within Zope, i.e., so I could
edit the new format in the edit window and have it displayed as HTML by
the server, handled as a Zope object, etc.?
Check out the integration of reStructuredText in Zope 2.7.

-aj

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] umount/remount

2003-03-07 Thread Shane Hathaway
Florent Guillaume wrote:
Is there any way to unmount then remount a mounted storage from a
running Zope?
Use case: mounting it read-only most of the time, and switching to
read-write at selected points when updates are allowed.
It would be fairly easy (no unmount necessary--just toggle the 
readonly flag on a running database), but the bigger question is how 
users will toggle the flag.  Through the control panel?

Shane

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] implementing structured text alternative w/in Zope

2003-03-07 Thread J Cameron Cooper


I'm a programmer but new to Zope. I'm developing a text markup language
like Structured Text that better suits my needs outside the Zope/Python
world. Would I be able to incorporate it within Zope, i.e., so I could
edit the new format in the edit window and have it displayed as HTML by
the server, handled as a Zope object, etc.?
I'd like to do it as transparently as (on the lowest level) possible,
but if it turns out I have to do it as a feature of a product, that
will be OK. Any tips for either scenario much appreciated.
Remember that in the grand scheme of things, most everything in Zope is 
a Product. And practically everything can be manipulated by a product. 
Especially with what you intend to do: not too long ago was ZPT an 
add-on product, as well as STX. DTML and ZSQLMethods are implemented as 
products. So you're not really losing anything by doing it that way. If 
what you're doing is really useful and general, perhaps it will be added 
to the Zope distribution sometime in the future, but you needn't count 
on that.'

  --jcc

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] How to trigger Zope externally (mail)

2003-03-07 Thread Ross Boylan
On Wed, Feb 26, 2003 at 05:37:17PM -0800, Andy McKay wrote:
 Or just write a simple HTTP post using Python. Have a look around for 
 the MailIn Product, or CMFMailIn which does this very simply and works 
 fine for low volume traffic (eg: fine listening to [EMAIL PROTECTED]).

Thanks.  I borrowed from CMFMailIn; I couldn't find the MailIn product.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )