*** nebo has joined #zope3-dev | 00:03 | |
*** natea has joined #zope3-dev | 00:14 | |
*** Aiste has joined #zope3-dev | 00:14 | |
*** rocky is now known as rocky|away | 00:14 | |
*** xenru has quit IRC | 00:15 | |
*** J1m has quit IRC | 00:30 | |
*** natea|away has quit IRC | 00:31 | |
*** flox has quit IRC | 00:36 | |
*** timte has quit IRC | 00:45 | |
*** RaFromBRC|lunch is now known as RaFromBRC | 01:03 | |
*** natea_ has joined #zope3-dev | 01:08 | |
*** autocoder has quit IRC | 01:12 | |
*** natea has quit IRC | 01:22 | |
*** jfroche_ has joined #zope3-dev | 01:33 | |
*** natea_ is now known as natea|away | 01:38 | |
*** jfroche has quit IRC | 01:48 | |
*** ksmith99 has joined #zope3-dev | 01:53 | |
*** yota has quit IRC | 01:54 | |
*** natea has joined #zope3-dev | 02:00 | |
*** febb has joined #zope3-dev | 02:08 | |
*** natea|away has quit IRC | 02:15 | |
*** jfroche_ has quit IRC | 02:25 | |
febb | hello | 02:27 |
---|---|---|
*** rocky|away is now known as rocky|Zzz | 02:39 | |
*** nathany has quit IRC | 02:46 | |
*** natea_ has joined #zope3-dev | 02:52 | |
*** ksmith99 has quit IRC | 02:54 | |
*** febb has quit IRC | 02:58 | |
*** natea has quit IRC | 03:00 | |
*** xenru_ has quit IRC | 03:02 | |
*** b_52CEntos_ has joined #zope3-dev | 03:13 | |
*** WebMaven has joined #zope3-dev | 03:17 | |
*** nebo has quit IRC | 03:18 | |
*** WebMaven has quit IRC | 03:18 | |
*** wrobel has quit IRC | 03:20 | |
*** b_52GM has quit IRC | 03:21 | |
*** tarek has quit IRC | 03:41 | |
*** natea has joined #zope3-dev | 03:44 | |
*** natea_ has quit IRC | 04:00 | |
*** niemeyer has quit IRC | 04:00 | |
*** adamSummers has joined #zope3-dev | 04:09 | |
*** reco has joined #zope3-dev | 04:20 | |
*** RaFromBRC has quit IRC | 04:21 | |
*** natea_ has joined #zope3-dev | 04:37 | |
*** natea has quit IRC | 04:52 | |
*** adamSummers has quit IRC | 05:08 | |
*** adamSummers has joined #zope3-dev | 05:08 | |
*** stub has joined #zope3-dev | 05:13 | |
*** alecm has quit IRC | 05:42 | |
*** natea has joined #zope3-dev | 05:59 | |
*** Theuni has quit IRC | 06:12 | |
*** Theuni has joined #zope3-dev | 06:13 | |
*** natea_ has quit IRC | 06:15 | |
*** stub has quit IRC | 06:50 | |
*** Theuni has quit IRC | 06:51 | |
*** Theuni has joined #zope3-dev | 06:51 | |
*** natea_ has joined #zope3-dev | 06:52 | |
*** baijum has joined #zope3-dev | 07:04 | |
*** natea has quit IRC | 07:07 | |
*** zagy has quit IRC | 07:39 | |
*** natea has joined #zope3-dev | 07:44 | |
*** natea_ has quit IRC | 08:01 | |
*** BjornT__ is now known as BjornT | 08:08 | |
*** eins has joined #zope3-dev | 08:12 | |
*** d2m has left #zope3-dev | 08:30 | |
*** natea_ has joined #zope3-dev | 08:37 | |
*** d2m has joined #zope3-dev | 08:45 | |
*** natea has quit IRC | 08:45 | |
*** philiKON_ has joined #zope3-dev | 08:52 | |
*** philiKON has quit IRC | 09:01 | |
*** tarek has joined #zope3-dev | 09:02 | |
*** timte has joined #zope3-dev | 09:11 | |
*** tarek has quit IRC | 09:15 | |
*** philiKON_ is now known as philiKON | 09:25 | |
*** hdima has joined #zope3-dev | 09:28 | |
*** natea has joined #zope3-dev | 09:29 | |
*** tarek has joined #zope3-dev | 09:31 | |
*** opetznick has joined #zope3-dev | 09:35 | |
*** natea_ has quit IRC | 09:37 | |
*** dobee has joined #zope3-dev | 09:49 | |
*** HakTom has joined #zope3-dev | 09:54 | |
*** yota has joined #zope3-dev | 10:03 | |
*** wrobel has joined #zope3-dev | 10:15 | |
*** jfroche has joined #zope3-dev | 10:46 | |
*** flox has joined #zope3-dev | 10:52 | |
*** natea_ has joined #zope3-dev | 10:53 | |
*** natea has quit IRC | 11:07 | |
*** jinty has joined #zope3-dev | 11:27 | |
*** natea has joined #zope3-dev | 11:44 | |
*** tarek_ has joined #zope3-dev | 11:53 | |
*** tarek has quit IRC | 11:56 | |
*** natea_ has quit IRC | 12:01 | |
*** tarek has joined #zope3-dev | 12:06 | |
*** Aiste has quit IRC | 12:09 | |
*** tarek_ has quit IRC | 12:14 | |
*** natea_ has joined #zope3-dev | 12:37 | |
*** Aiste has joined #zope3-dev | 12:43 | |
*** baijum_ has joined #zope3-dev | 12:44 | |
*** natea has quit IRC | 12:52 | |
*** baijum has quit IRC | 12:56 | |
*** niemeyer has joined #zope3-dev | 13:09 | |
*** mgedmin has joined #zope3-dev | 13:09 | |
*** mkerrin has joined #zope3-dev | 13:12 | |
*** dunny has quit IRC | 13:14 | |
*** tarek_ has joined #zope3-dev | 13:14 | |
*** baijum_ is now known as baijum | 13:18 | |
*** tarek has quit IRC | 13:20 | |
*** dobee has quit IRC | 13:20 | |
*** grahal has joined #zope3-dev | 13:28 | |
*** natea has joined #zope3-dev | 13:29 | |
*** tarek__ has joined #zope3-dev | 13:29 | |
*** tarek_ has quit IRC | 13:34 | |
*** b_52CEntos_ has quit IRC | 13:37 | |
*** natea_ has quit IRC | 13:44 | |
*** stub has joined #zope3-dev | 13:46 | |
*** ignas has joined #zope3-dev | 13:59 | |
*** b_52Centos has joined #zope3-dev | 14:03 | |
*** dobee has joined #zope3-dev | 14:08 | |
*** batlogg has joined #zope3-dev | 14:32 | |
*** stub has quit IRC | 14:36 | |
*** ignas has quit IRC | 14:41 | |
*** edgordon has joined #zope3-dev | 14:44 | |
*** baijum has quit IRC | 14:53 | |
*** marcin_ant has joined #zope3-dev | 14:59 | |
*** marcin_ant has quit IRC | 15:07 | |
*** natea has quit IRC | 15:07 | |
*** tarek__ is now known as tarek | 15:10 | |
*** BjornT has quit IRC | 15:11 | |
*** marcin_ant has joined #zope3-dev | 15:16 | |
*** BjornT- has joined #zope3-dev | 15:22 | |
*** BjornT- is now known as BjornT | 15:23 | |
*** BjornT_ has joined #zope3-dev | 15:40 | |
*** hazmat has joined #zope3-dev | 15:47 | |
*** ChanServ sets mode: +o hazmat | 15:47 | |
*** hazmat has quit IRC | 16:02 | |
*** tarek_ has joined #zope3-dev | 16:05 | |
*** gumpa has joined #zope3-dev | 16:05 | |
*** waglik has joined #zope3-dev | 16:07 | |
waglik | 'lo! | 16:09 |
waglik | is it possible to construct an interface definition at runtime? | 16:10 |
mgedmin | yes, but usually you should not need to do that | 16:13 |
waglik | Basically, I'm building an application with user-defined shipment documents. | 16:14 |
waglik | Every document has a heading and a set of lines, with user defined fields | 16:15 |
waglik | the definitions are stored in postgres database | 16:15 |
waglik | I've figured out, it would be easiest to construct a Interface from the definition and prepare a formlib Form to get and validate the lines | 16:17 |
waglik | mgedmin: can you tell me how to construct the Interface at runtime? | 16:17 |
waglik | mgedmin: I've tried: ILine['field'] = Int(...) | 16:18 |
waglik | mgedim: ILine.field = Int(...) | 16:18 |
waglik | and it seems it doesn't work either way | 16:18 |
*** tarek has quit IRC | 16:19 | |
mgedmin | waglik: you do not need to create an interface! | 16:21 |
mgedmin | you need to create a form.Fields() object | 16:21 |
mgedmin | form.Fields(Int(__name__='foo', title=...), TextLine(...)) | 16:21 |
mgedmin | you can also add fields together | 16:21 |
mgedmin | form.Fields(...) + form.fields(...) | 16:21 |
*** hazmat has joined #zope3-dev | 16:28 | |
*** ChanServ sets mode: +o hazmat | 16:28 | |
* waglik slaps his forehead :) | 16:34 | |
waglik | heh, i forgot it's that simple | 16:34 |
waglik | :) | 16:34 |
*** J1m has joined #zope3-dev | 16:36 | |
*** eins has quit IRC | 16:40 | |
*** hdima has quit IRC | 17:06 | |
*** ignas has joined #zope3-dev | 17:16 | |
*** waglik has quit IRC | 17:18 | |
*** BjornT has quit IRC | 17:18 | |
*** grahal is now known as grahalAFK | 17:35 | |
*** ignas has quit IRC | 17:36 | |
*** grahalAFK is now known as grahal | 17:44 | |
*** b_52Centos has quit IRC | 17:46 | |
*** BjornT_ has quit IRC | 17:50 | |
*** flox has quit IRC | 18:01 | |
*** J1m has quit IRC | 18:03 | |
*** edgordon has quit IRC | 18:04 | |
*** projekt01 has joined #zope3-dev | 18:08 | |
*** J1m has joined #zope3-dev | 18:10 | |
*** BjornT has joined #zope3-dev | 18:14 | |
*** andrew_m has quit IRC | 18:17 | |
*** ignas has joined #zope3-dev | 18:20 | |
*** hazmat has quit IRC | 18:36 | |
*** projekt01 has quit IRC | 18:37 | |
*** edgordon has joined #zope3-dev | 18:37 | |
*** batlogg has quit IRC | 18:47 | |
*** opetznick has quit IRC | 18:47 | |
*** edgordon has quit IRC | 18:50 | |
*** alecm has joined #zope3-dev | 18:53 | |
*** jfroche has quit IRC | 18:56 | |
*** edgordon has joined #zope3-dev | 18:59 | |
*** philiKON has quit IRC | 19:02 | |
*** hazmat has joined #zope3-dev | 19:03 | |
*** ChanServ sets mode: +o hazmat | 19:03 | |
*** batlogg has joined #zope3-dev | 19:03 | |
*** philiKON has joined #zope3-dev | 19:11 | |
alecm | philiKON: Is it OK if I check a failing test into Five, I'm still at a bit of a loss about how to fix this security thing. | 19:17 |
philiKON | make a branch? | 19:17 |
alecm | Well, from what I'm seeing this can't be fixed in Five unless we do something really nasty. | 19:17 |
alecm | Essentially zope's two traversal mechanisms (request traversal and object traversal) are doing their checks differently | 19:18 |
alecm | things that are unusable from restricted code work just fine when called via url, which is really bad | 19:19 |
philiKON | uh, yes | 19:19 |
philiKON | how does zope deal with this problem normally, though? | 19:19 |
philiKON | i mean, there's lots of such cases in zope 2 itself, right? | 19:19 |
alecm | In those cases private methods are generally explicitly marked as such on the class | 19:20 |
philiKON | using _? | 19:20 |
*** ignas has quit IRC | 19:22 | |
alecm | Using security.declarePrivate(methodname) or __${methodname}__roles__ = (). From restricted code methods with no security declarations are disallowed, in traversal they are allowed if the permissions on the most recent object in the aq_chain that had a security declaration would allow access to a user with the current users roles. | 19:23 |
alecm | Or by not putting in a docstring | 19:23 |
alecm | which is pretty common I guess | 19:23 |
philiKON | and that approach doesn't work in browser views? | 19:24 |
alecm | The only reason I hadn't noticed this bug is because I am usually pretty lax about putting docstrings in place, esp when the interface has a docstring. | 19:24 |
alecm | philiKON: Sure it does, but in views we generally want to be able to do the security declarations using zcml, no? | 19:25 |
philiKON | sure | 19:25 |
alecm | We'd have to introspect the class and make all methods private | 19:25 |
philiKON | yeah | 19:25 |
alecm | but some need to be made protected/public | 19:25 |
philiKON | doesn't declareObjectProviate() work? | 19:25 |
philiKON | the IBrowserPublisher methods need to be protected/public | 19:26 |
philiKON | browserDefault, __call__, etc. | 19:26 |
alecm | marking the class as private in all cases works but is prevents using the view directly from restricted code, like tal:define="view nocall:context/@@myview" | 19:26 |
philiKON | i see | 19:27 |
philiKON | so, lemme ask: | 19:27 |
alecm | (it also breaks a bunch of tests that rely on this behavior) | 19:27 |
philiKON | would this solve the problem: | 19:27 |
philiKON | in browser;page we take a look at the class and declare everything private that | 19:28 |
philiKON | * is not part of IBrowserPublisher and | 19:28 |
philiKON | * is not listed explicitly in allowed_attributes | 19:28 |
philiKON | ? | 19:28 |
*** reco has quit IRC | 19:29 | |
alecm | Yes, though I'm not sure we have the allowed_attributes info when declaring the security on the class, it's also a little hack-y | 19:29 |
alecm | Unfortunately, I have to go :-( | 19:29 |
philiKON | ttyl | 19:29 |
philiKON | allowed_attributes would have to be supplied by whoever writes the view and registers it | 19:29 |
alecm | Yeah, but the handler for 'permission' doesn't know about it, right? | 19:30 |
philiKON | browser:page knows about it | 19:31 |
philiKON | i think it'll work | 19:31 |
alecm | philiKON: OK, so what's the best way to find the methods on a class, iterate through the __dict__ looking for instances of FunctionType? Or is there something better? | 19:39 |
philiKON | dir(class) | 19:39 |
philiKON | and then look for FunctionType | 19:40 |
philiKON | or, methodtype | 19:40 |
philiKON | unbound method type to be exact | 19:40 |
*** Londo_ has joined #zope3-dev | 19:44 | |
alecm | I was mistaken and did not have to go :-) | 19:48 |
alecm | It looks like it might be working, though it seems a bunch of the existing ftests depend on this bad behavior :-) | 19:49 |
mgedmin | inspect.ismethod() might be useful | 19:53 |
*** tonico|away is now known as tonico | 19:54 | |
mgedmin | hmm... inspect.getmembers(class, inspect.ismethod) | 19:55 |
mgedmin | inspect.classify_class_attrs is also interesting | 19:55 |
mgedmin | alecm: hope that's useful for you | 19:55 |
alecm | mgedmin: Thanks | 19:56 |
*** alecm has quit IRC | 19:56 | |
*** opetznick has joined #zope3-dev | 19:56 | |
*** alecm has joined #zope3-dev | 19:59 | |
*** batlogg has quit IRC | 20:00 | |
*** rocky|Zzz is now known as rocky | 20:10 | |
alecm | philiKON: Thanks, looks like it's working. I've checked it into 1.4 branch and I'll port to other branches later. | 20:14 |
*** RaFromBRC has joined #zope3-dev | 20:17 | |
*** batlogg has joined #zope3-dev | 20:30 | |
*** rocky is now known as rocky|away | 20:40 | |
philiKON | alecm: you da man | 20:42 |
*** dunny has joined #zope3-dev | 20:45 | |
*** gumpa is now known as gumpa_afk | 20:48 | |
hazmat | alecm, you can get a minor abstraction using.. inspect .. getmembers( klass, lambda y: isinstance( y, types.FunctionType) ) | 20:57 |
mgedmin | hazmat: are you saying that "inspect.getmembers(class, inspect.ismethod)" would not work? | 20:58 |
*** Londo_ has quit IRC | 20:59 | |
*** henri_ has joined #zope3-dev | 21:00 | |
*** tarek_ has quit IRC | 21:03 | |
hazmat | mgedmin, yeah... that would work too.. just didn't see it | 21:03 |
*** dobee has quit IRC | 21:04 | |
*** dobee has joined #zope3-dev | 21:05 | |
*** tarek_ has joined #zope3-dev | 21:08 | |
*** henri_ has left #zope3-dev | 21:35 | |
*** Londo_ has joined #zope3-dev | 21:37 | |
*** grahal has quit IRC | 21:41 | |
*** tarek has joined #zope3-dev | 21:48 | |
*** romanofski has joined #zope3-dev | 21:50 | |
*** tarek_ has quit IRC | 21:54 | |
*** hazmat has quit IRC | 21:56 | |
*** tonico has quit IRC | 21:58 | |
*** mkerrin has quit IRC | 22:02 | |
*** hazmat has joined #zope3-dev | 22:02 | |
*** ChanServ sets mode: +o hazmat | 22:02 | |
*** HakTom has quit IRC | 22:02 | |
*** mgedmin has quit IRC | 22:09 | |
*** alecm has quit IRC | 22:11 | |
*** tarek has quit IRC | 22:12 | |
*** opetznick has quit IRC | 22:15 | |
*** gumpa_afk is now known as gumpa | 22:18 | |
*** hazmat has quit IRC | 22:18 | |
*** deo has joined #zope3-dev | 22:21 | |
*** rocky|away is now known as rocky | 22:28 | |
*** daniele has joined #zope3-dev | 22:31 | |
*** whit is now known as whit|lunch | 22:34 | |
*** dobee has quit IRC | 22:36 | |
*** jinty has quit IRC | 22:42 | |
*** RaFromBRC is now known as RaFromBRC|lunch | 22:50 | |
*** whit|lunch is now known as whit | 22:50 | |
*** dunny has quit IRC | 22:52 | |
*** whit is now known as whit|busy | 22:54 | |
*** flox has joined #zope3-dev | 22:58 | |
*** dobee has joined #zope3-dev | 23:12 | |
*** RaFromBRC|lunch is now known as RaFromBRC | 23:33 | |
*** ksmith99 has joined #zope3-dev | 23:36 | |
*** nathany has joined #zope3-dev | 23:38 | |
*** romanofski has quit IRC | 23:40 | |
*** whit|busy is now known as whit | 23:45 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!