[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ Collector #1926: fixed a typo in _doAddUser when password encryption is
Log message for revision 39540: Collector #1926: fixed a typo in _doAddUser when password encryption is enabled. Changed: U Zope/branches/Zope-2_8-branch/doc/CHANGES.txt U Zope/branches/Zope-2_8-branch/lib/python/AccessControl/User.py -=- Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt === --- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-10-20 15:07:29 UTC (rev 39539) +++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt 2005-10-21 00:06:17 UTC (rev 39540) @@ -22,6 +22,13 @@ - Collector #1233: port ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8 + After Zope 2.8.3 + +Bugs Fixed + + - Collector #1926: fixed a typo in _doAddUser when password +encryption is enabled. + Zope 2.8.3 (2005/10/18) Other Modified: Zope/branches/Zope-2_8-branch/lib/python/AccessControl/User.py === --- Zope/branches/Zope-2_8-branch/lib/python/AccessControl/User.py 2005-10-20 15:07:29 UTC (rev 39539) +++ Zope/branches/Zope-2_8-branch/lib/python/AccessControl/User.py 2005-10-21 00:06:17 UTC (rev 39540) @@ -1045,7 +1045,7 @@ def _doAddUser(self, name, password, roles, domains, **kw): Create a new user if password is not None and self.encrypt_passwords \ - and not self._isPasswordEncrypted(pw): + and not self._isPasswordEncrypted(password): password = self._encryptPassword(password) self.data[name]=User(name,password,roles,domains) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
Re: [Zope-dev] Mountpoints
Tim Peters wrote: [Chris McDonough] There is a wrinkle about performing this merge that eluded my memory until now. To support multidatabases within Zope, it was reasonable to change ZODB.config.ZODBDatabase to support the heretofore likely-unused-by-real-world-code databases and database_name options that may now be passed into ZODB.DB's constructor: http://svn.zope.org/ZODB/branches/blob-merge-branch/src/ZODB/config.py?rev=38626r1=38574r2=38626 The current blob-merge-branch code depends on this change being available in the ZODB revision it uses. In case you're interested, the code that actually makes use of this feature in the zodb-blobs-branch is in the Zope2.datatypes.DBTab.getDatabase method. Is this change acceptable for a merge into the ZODB HEAD? Turns out that a release of Zope3 has already been made that supports multidatabases, and I'd naturally prefer to follow the lead of a Zope that's already out there. Jim showed me the Zope3 implementation code and an example today. I found the code easily (on Zope3 trunk), but can't for the life of me find anything there that looks like his example. Jim, where is that? Do you mean an example of a zope.conf that uses it? From a customer engagement: zodb main filestorage path $DATADIR/Data.fs /filestorage /zodb zodb a filestorage path $DATADIR/A.fs /filestorage /zodb We decided to use the section names for the database names. This was to avoid changing ZODB. I'm not sure that that was a good idea. This approach has two disadvantages: - Because section names are case insenstive, database names end up being lower case, whether we want them to be or not. - It may not be obvious that the section name is also the database name. I'm really unsure about whether this is a disadvantage. I'm not sure if: zodb name main filestorage path $DATADIR/Data.fs /filestorage /zodb zodb name a filestorage path $DATADIR/A.fs /filestorage /zodb is better or worse than the first version. I'm inclined to think that any time you have sections of the same type, it is desireable to give them names, in which case we might be tempted to list the names twice. The Zope3 code in question is in src/zope/app/appsetup/appsetup.py function multi_database(). Note that they didn't change any ZODB files, instead they give values to a DB's .databases and .database_name attributes after constructing the DB. While that might be questionable in general cough, the implementation of multidatabases was meant to be both concrete and public. It's not an accident that ZODB's tutorial tests/multidb.txt doctest explains and exploits details of the concrete implementation -- it's not meant to be abstract. IOW, poking in new values for these attributes isn't considered to be evil. I'd be happy to plumb this through the factories open method. It would seem to me that we only need to be able to pass a databases argument. The factory presumably knows it's own name. It could then pass the databases dict and the name to the DB constructor. I believe (here's where the example I can't find would nail it) they use the name on a zodb section as the DB's database_name. Fred points out that ZConfig section names are case-insensitive, forced to lowercase, so that zodb CHRIS and zodb cHris have the same name. That's not ideal, and threading these attributes throughout ZODB's config.py instead (as you did) would be a sane way to worm around that. I haven't looked at Chris's changes. I was pretty happy that the changes we made in Z3 were fairly localized and small. But for right now, I think doing it differently than Zope3 does it would cause needless confusion more than it would help. Enhancing Zope3 and Zope 2.9 in the same way(s) here could make sense. OTOH, this feature has hardly been used in Z3. I added to ZODB because I had been meaning to for some time ad because we needed it for a customer. I don't think anyone else has used it, so I don't think there's much established pattern in Z3. Then again, I'm not sure, except for the case insentitivity issue that we didn't do it the best way. I'd much rather revisit the case insenstitivity of section names in ZConfig. I think that if ZConfig section names were case sensitive or at least case preserving, I'd be happy with the approach we took. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Re: [Zope-CMF] Better DeprecationWarnings (was Re: SVN: CMF/trunk/CMFDefault/Portal.py - reverted Portal.py change of r39125 to fix BBB temporarily)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Withers wrote: Tres Seaver wrote: Note that I have just figured out that we can make DeprecationWarnings more useful by passing the 'stacklevel' argument to 'warnings.warn'; passing a value of 2 for that argument causes the warning to be reported against the *caller* of the code issuing the warning, which makes it possible to find and remove the deprecated use. Oooh, coool. Reckon it'd be a good idea if I changed all the deprecation warnings in Zope to do the same? +10. I've always found them totally useless 'cos they don't tell you where they come from and so you can't fix them... Bit like the random ZODB errors when it no longer has the class for some long-forgotten object burried deep in an opaque pickled data structure which you have no hope of ever finding and deleting... but I digress ;-) Tres. - -- === Tres Seaver +1 202-558-7113 [EMAIL PROTECTED] Palladion Software Excellence by Designhttp://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDV7I2+gerLs4ltQ4RAiTPAJ9ARNJ9C33+BrFMfD7bIgoMNSryQACgtGc5 nzgXeHE9NTZ79BQ5dF9rkN8= =B+U3 -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org 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: [Zope-CMF] Better DeprecationWarnings (was Re: SVN: CMF/trunk/CMFDefault/Portal.py - reverted Portal.py change of r39125 to fix BBB temporarily)
[Tres Seaver -- I think; I'm missing context for this email] Note that I have just figured out that we can make DeprecationWarnings more useful by passing the 'stacklevel' argument to 'warnings.warn'; passing a value of 2 for that argument causes the warning to be reported against the *caller* of the code issuing the warning, which makes it possible to find and remove the deprecated use. I can recommend the approach I use in ZODB. There's a utility module in ZODB, containing (among other things) functions like this one: # Raise DeprecationWarning, noting that the deprecated thing will go # away in ZODB 3.6. Point to the caller of our caller (i.e., at the # code using the deprecated thing). def deprecated36(msg): warnings.warn(This will be removed in ZODB 3.6:\n%s % msg, DeprecationWarning, stacklevel=3) So every gimmick that's going to go away in ZODB 3.6 imports `deprecated36` from the utility module, and calls it with an appropriate message. As an intended bonus, when I release ZODB 3.6 I can just grep for deprecated36 to _find_ the code that's supposed to go away (I also annotate tests and docs that should go away with deprecated36). Using a common function also ensures that every deprecation warning starts with the same string (identifying the release in which the thing will go away). Note: sometimes _internals_ use deprecated gimmicks in order to support deprecated gimmicks too, and then stacklevel=3 is too small. It's happened so rarely in ZODB that I haven't tried to do something about that yet. ___ Zope-Dev maillist - Zope-Dev@zope.org 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] Mountpoints
[Tim Peters, on multidatabase support in Zope3] ... Jim showed me the Zope3 implementation code and an example today. I found the code easily (on Zope3 trunk), but can't for the life of me find anything there that looks like his example. Jim, where is that? [Jim Fulton] Do you mean an example of a zope.conf that uses it? Yes, that's all -- just a concrete example. I could have guessed one (and did later ;-)), but guesses can be wrong. From a customer engagement: zodb main filestorage path $DATADIR/Data.fs /filestorage /zodb zodb a filestorage path $DATADIR/A.fs /filestorage /zodb Thanks! That did the trick. We decided to use the section names for the database names. This was to avoid changing ZODB. I'm not sure that that was a good idea. Let's change it. This approach has two disadvantages: - Because section names are case insenstive, database names end up being lower case, whether we want them to be or not. - It may not be obvious that the section name is also the database name. It isn't obvious -- and unlike for other zodb keys, a user can't look in ZODB's component.xml now to find out anything about this usage. They can, e.g., look there to see that they can specify cache-size, that it's an integer, and that it defaults to 5000. They can also find helpful description sections for many keys. Using the section name is pure out-of-the-blue magic in contrast. I'm really unsure about whether this is a disadvantage. I'm not sure if: zodb name main filestorage path $DATADIR/Data.fs /filestorage /zodb zodb name a filestorage path $DATADIR/A.fs /filestorage /zodb is better or worse than the first version. I think it's worse, but mostly because a key with name name is also an option in _related_ sections, but with unrelated meaning. For example, if you had a nested zeoclient section there it could also have specified a name key, which would have nothing to do with the zodb key named name. Nesting options with the same name gets confusing quickly. OTOH, I would like the explicit key better if it had a different name, say zodb multidb-name main filestorage path $DATADIR/Data.fs /filestorage /zodb zodb multidb-name a filestorage path $DATADIR/A.fs /filestorage /zodb I'm inclined to think that any time you have sections of the same type, it is desireable to give them names, in which case we might be tempted to list the names twice. Sounds orthogonal to me. If it's desirable that whenever multiple sections of the same type appear, they must be given names, that's fine, but the way to enforce or encourage that isn't to make all sections that may appear more than once give some _meaning_ to the section name. It was just expedient in this specific case, right? ... I'd be happy to plumb this through the factories open method. It would seem to me that we only need to be able to pass a databases argument. Right. The factory presumably knows it's own name. It could then pass the databases dict and the name to the DB constructor. If I change the zodb config to say there's a new optional key for the multidatabase name (like the multidb-name key in the made-up example above), then the factory will have the same access to that as it has for other existing ZConfig-specified keys (like cache-size). BTW, I think there's a related buglet in Zope3's multi_database(): name = factory.name or '' ... db.database_name = name Defaulting to an empty string for the name is really a bit of abuse, since the documented default database_name for ZODB.DB is unnamed, and I doubt Zope3 documented that it changed this default ;-). An explicit ZConfig key here would supply that correct default. ... I haven't looked at Chris's changes. I was pretty happy that the changes we made in Z3 were fairly localized and small. Adding the optional new key to the zodb config, and threading the `databases` arg thru ZODB's config.py, are also small changes. But for right now, I think doing it differently than Zope3 does it would cause needless confusion more than it would help. Enhancing Zope3 and Zope 2.9 in the same way(s) here could make sense. OTOH, this feature has hardly been used in Z3. I added to ZODB because I had been meaning to for some time ad because we needed it for a customer. I don't think anyone else has used it, so I don't think there's much established pattern in Z3. Then again, I'm not sure, except for the case insentitivity issue that we didn't do it the best way. I'd much rather revisit the case insenstitivity of section names in ZConfig. I think that if ZConfig section names were case sensitive or at least case preserving, I'd be happy with the approach we took. Note that if we add an explicit new key, the case issue goes away (for this specific
Re: [ZWeb] Re: [Zope.org-internal] Re: [Zopeorg-webmaster] Download of Zope 2.8.3 is not possible
Chris Withers wrote: Sidnei da Silva wrote: On Wed, Oct 19, 2005 at 04:17:02PM -0400, Jim Fulton wrote: | | I don't think that's a CMF 'feature', unless the product is using | | 'contentValues()' which is part of the CMF API. | | BTW, this doesn't mean anything to me. I guess it doesn't. It did to me. I tried to solve this properly by actually going and editing the disk based software. The results are in Products/CMFPackage/SoftwarePackage.py.chrisw.2005-10-20 on app1. It was only after several confusing refreshes on zope.org that I remembered Andrew saying he'd added another app server to Zope.org. *sigh* It'd be REAL nice if even the hardware setup of zope.org was documented SOMEWHERE so that if any of us do get pissed off enough to actually try and fix anything, we have a vague clue of where we need to go to update stuff :-( I made an attempt to document the hardware setup. I announced this a long time ago. If you have the right privileges, you can: svn co svn+ssh://svn.zope.org/repos/zope.org/system-documentation/trunk I don't think it's up to date, but it does reflect at least a partial reality. I wish this would be kept up to date. :/ ... Admittedly, this hides a load of potential other problems, but no-one really cares, right? ;-) Nope. We are just limping along until the ZF can create a new new (or is that new new new) zope.org. :/ Anyway, I'm going to go and beat some walls down with my head. Hope the changes I've made help even a little... Much thanks Chris! Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope-web maillist - Zope-web@zope.org http://mail.zope.org/mailman/listinfo/zope-web
Re: [ZWeb] Re: [Zope.org-internal] Re: [Zopeorg-webmaster] DownloadofZope 2.8.3 is not possible
Andrew Sawyers wrote: Actually, this is annoying. I increasingly find docs useless for this very reason. I waste my time writing them. People bitch about them not being there or not correct, and they actually never even look. It is documented - and it's documented correctly. I don't know how anyone would look. You have to check something out to look. I announced this a long time ago and it's not surprising to me that people forgot. I mainly remembered because I created it in the first place. Having said that, we who have system access should all, on our local hard drives, have a directory where we keep information relevent to z.o. In that directory, there should be a checkout of the docs. If you don't have one, here's the command you give: svn co svn+ssh://svn.zope.org/repos/zope.org/system-documentation/trunk zope.org-system-docs Then, you will at least have some information that will remind you that the documentation exists. You should periodically update this. Don't count on being able to check it out in an emergency, as the system it's on may be down. (Or it's Berkeley database may be hosed.) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope-web maillist - Zope-web@zope.org http://mail.zope.org/mailman/listinfo/zope-web
[Zope] Re: Need for advice ...
I'm not sure how difficult it is to install Linux on this h/w but if you can, this will make life easier for you in many ways in addition to being easier to host Plone/Zope ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] __getitem__ and returning a PageTemplateFile instance
On Wed, Oct 19, 2005 at 09:47:50PM +0200, Dieter Maurer wrote: Zope has encountered a problem publishing your object. Cannot locate object at: http://localhost:8080/vitester/asonhe This is a NotFound problem. Zope is unable to locate vitester/asonhe Are you sure, vitester/asonhe is there? asonhe is not there, but vitester has a __getitem__ method which executes a PageTemplateFile instance and returns it. I.e. return self.test(self, self.REQUEST, value=value) (where self.test is a PageTemplateFile) It actually works if I just do: return self.test.__of__(self) But that way I can't put any values in there. How can I do this then? Do I need to make a completely new custom item to return or what? -- Anders -BEGIN GEEK CODE BLOCK- Version: 3.12 GCS/O d--@ s:+ a-- C++ UL+++$ P++ L+++ E- W+ N(+) o K? w O-- M- V PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b++ DI+++ D+ G e- h !r y? --END GEEK CODE BLOCK-- PGPKey: http://random.sks.keyserver.penguin.de:11371/pks/lookup?op=getsearch=0xD4DEFED0 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Hello
On 10/20/05, Pierre Thibault [EMAIL PROTECTED] wrote: Andrew Milton a écrit : +---[ Pierre Thibault ]-- | Hello, | | Is someone reading this message? No. :-) I am new to Zope. So I would like to learn. On the Zope website it is written to do the tutorials bundle with the Zope installation but where are they? After installation, I was unable to find them. I also plan to learn Plone after Zope, is it a good path? No, I think it's better to start with Plone, and Python. Start with the high-level usage (Plone), and dig downwards, and start with the low-level nitty-gritty (Python) and work upwards. Starting from the middle tends to confuse. :) It also tends to lead you into things that are pretty much dead-ends from a Plone standpoint, such as DTML and ZClasses. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Hello
Oh, and another thing: On 10/20/05, Pierre Thibault [EMAIL PROTECTED] wrote: I also plan to learn Plone after Zope, is it a good path? [...] /Users/pierreth/Download/Zope-3.1.0/build/lib.darwin-8.2.0-Power_Macintosh-2.3/zdaemon/tests/testzdrun.py, line 260, in testUmask You installed Zope 3.1. Zope 3 is very different from Zope 2, and Plone does not run on it. So, the question is of you want to learn Zope 2 or Zope 3. Which leads to the question: What is your goal with learning Zope? ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Need for advice ...
On 10/20/05, Nick Davis [EMAIL PROTECTED] wrote: I'm not sure how difficult it is to install Linux on this h/w but if you can, this will make life easier for you in many ways in addition to being easier to host Plone/Zope Debian is supposed to run fine. Also OpenBSD has a sparc port which could be an alternative. And new CPU boards cost, like, nothing, so it could be a pretty cool server. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] write file to FS (LocalFS?)
Rakotomandimby Mihamina wrote: On Wed, 2005-10-19 at 13:44 +0100, Chris Withers wrote: Rakotomandimby Mihamina wrote: I am on a unix-like operating system, Zope 2.8, CMF, CPS (SVN Trunk). I would like users to be abble to write some file on the filesystem. Why? I manage a group of users on a Unix system. They also have an FTP space, and a mailbox (on the system) They are members of the CPS hosted on the Zope. They want to change their FTP/POP/IMAP password. I would then have this modification done in a tightly controlled external method (from a security point of view) and make sure you use some big Locks (see python threading module's documentation) so multiple simultaneous requests don't cause carnage... I need to process their request into a batch file. Why a batch file? Obviuosly, ther is the LDAP common authentication for the groupware and the system, but the LDAP connection is a work still in progress... they want to change their passwords NOW. The quickest way I found is to code an interface (a form) in wich they ask for the password change. I would suggest just getting LDAP working ;-) cheers, Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] now learning zpt
Garry Saddington wrote: Would you also stop using dtml in zsql methods If I could, I would, but ZSQL methods only support DTML :-( (At least for mail there's now MailTemplates (plug, plug ;-) and you don't have to use dtml-sendmail anymore ;-) and do the processing of multiple records in python? Er? Not sure what you mean... Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] inheriting from SimpleUserFolder's User
[ Dieter Maurer wrote:] Jürgen Herrmann wrote at 2005-10-19 15:34 +0200: i use the SimpleUserFolder product and derive a MyUser class from it's included User class, which in turn inherits from BasicUser. the SimpleUserFolder's User class does neither reimplement getRolesInContext() nor allowed(). i looked at the source of BasicUser (lib/python/AccessControl/User.py) and found out that allowed() does not use the information provided by getRolesInContext(). i found this comment: # Still have not found a match, so check local roles. We do # this manually rather than call getRolesInContext so that # we can incur only the overhead required to find a match. so if i reimplement getRolesInContext() in MyUser, i'll probably also have to reimplement allowed() to reflect the possibly added local roles, right? Yes. ... ps: looking at the code of allowed() i doubt that the manual checking of local roles will speed this method up a lot: local roles seem to be a seldomly used feature, the improvement in speed would only occur if the object in question was protected by a local role Be careful about terminology! Objects are not protected by roles (but by permissions). k, i'll take care in the future :) You gain something if a near local role grants the necessary permission. The Owner local role tends to be very near. Thus, you may gain, when usually owners try to execute protected methods. sounds reasonable. (and not a normal one). is this enough to justify duplicated code with all of it's disadvantages)? Nobody prevents you to implement your allowed by means of getRolesInContext. -- Dieter ok, it just felt a little wrong to reimplement allowed... but if thats the way, fine by me! to dig a little deeper into zope's security machinery, does anybody know where to look at (in the source) f.ex. to find the place where the owner role is assigned to a user? best regards, juergen herrmann ___ XLhost.de - eXperts in Linux hosting Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.de ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: inheriting from SimpleUserFolder's User
Jürgen Herrmann wrote: [ Dieter Maurer wrote:] Jürgen Herrmann wrote at 2005-10-19 15:34 +0200: i use the SimpleUserFolder product and derive a MyUser class from it's included User class, which in turn inherits from BasicUser. the SimpleUserFolder's User class does neither reimplement getRolesInContext() nor allowed(). i looked at the source of BasicUser (lib/python/AccessControl/User.py) and found out that allowed() does not use the information provided by getRolesInContext(). i found this comment: # Still have not found a match, so check local roles. We do # this manually rather than call getRolesInContext so that # we can incur only the overhead required to find a match. so if i reimplement getRolesInContext() in MyUser, i'll probably also have to reimplement allowed() to reflect the possibly added local roles, right? Yes. ... ps: looking at the code of allowed() i doubt that the manual checking of local roles will speed this method up a lot: local roles seem to be a seldomly used feature, the improvement in speed would only occur if the object in question was protected by a local role Be careful about terminology! Objects are not protected by roles (but by permissions). k, i'll take care in the future :) You gain something if a near local role grants the necessary permission. The Owner local role tends to be very near. Thus, you may gain, when usually owners try to execute protected methods. sounds reasonable. (and not a normal one). is this enough to justify duplicated code with all of it's disadvantages)? Nobody prevents you to implement your allowed by means of getRolesInContext. -- Dieter ok, it just felt a little wrong to reimplement allowed... but if thats the way, fine by me! to dig a little deeper into zope's security machinery, does anybody know where to look at (in the source) f.ex. to find the place where the owner role is assigned to a user? That's done by OFS.ObjectManager._setObject. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] implicit vs. explicit ownership?
in AccessControl.Owned.Owned: def manage_changeOwnershipType(explicit=1, RESPONSE=None, REQUEST=None): Change the type (implicit or explicit) of ownership. can somebody please explain what's the difference between explicit and implicit here, or provide a rtfm hint? regards, juergen herrmann ___ XLhost.de - eXperts in Linux hosting Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.de ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Need for advice ...
Thanks for the replies. For now I'm going to try it with Solaris 10 for a few reasons: 1.- I try to get the most of its 6 SCSI discs, and the documentation I found for Solaris (http://docs.sun.com/app/docs/doc/816-4520) was much better than similiar one for Linux, including optimizations for various scenarios (write intensive vs read intensive, small vs large reads,...). 2.- I'm also interested in checking DTrace (http://users.tpg.com.au/adsln4yb/dtrace.html), that has got really good press in the media. 3.- Solaris Containers (similar to Xen, but again better documented than Xen). Anyway it's true that for a Linuxer like me Solaris is hard and even ugly (it took me one full day to setup IPsDNSs). If I success I will post a resume for reference. --- Lennart Regebro [EMAIL PROTECTED] escribió: On 10/20/05, Nick Davis [EMAIL PROTECTED] wrote: I'm not sure how difficult it is to install Linux on this h/w but if you can, this will make life easier for you in many ways in addition to being easier to host Plone/Zope Debian is supposed to run fine. Also OpenBSD has a sparc port which could be an alternative. And new CPU boards cost, like, nothing, so it could be a pretty cool server. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: implicit vs. explicit ownership?
Jürgen Herrmann wrote: in AccessControl.Owned.Owned: def manage_changeOwnershipType(explicit=1, RESPONSE=None, REQUEST=None): Change the type (implicit or explicit) of ownership. can somebody please explain what's the difference between explicit and implicit here, or provide a rtfm hint? Note that this is *executable* ownership, about which few people care (except those that develop code-like objects). Read http://www.zope.org/Members/jim/ZopeSecurity/ServerSideTrojan for background. Here the implicit or explicit executable ownership is just the fact that the _owner is acquired from the parent or explicitely set on the object. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of RD +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: implicit vs. explicit ownership?
[ Florent Guillaume wrote:] Jürgen Herrmann wrote: in AccessControl.Owned.Owned: def manage_changeOwnershipType(explicit=1, RESPONSE=None, REQUEST=None): Change the type (implicit or explicit) of ownership. can somebody please explain what's the difference between explicit and implicit here, or provide a rtfm hint? Note that this is *executable* ownership, about which few people care (except those that develop code-like objects). Read http://www.zope.org/Members/jim/ZopeSecurity/ServerSideTrojan for background. Here the implicit or explicit executable ownership is just the fact that the _owner is acquired from the parent or explicitely set on the object. thanks for your answer... hmm, i'm a bit confused now. do you say that changeOwnershipType() only has to do with executeable ownership? especially i have to know which methods of the IOwned interface are essential and have to be reimplemented properly on my objects. ...but the fog is clearing up a little bit now, i thought that the owner role would be completely dynamically assigned to a user by getRolesInContext, now i see that this is done at object creation time and more than one user can have the local role owner on an object. for my use cases i'd prefer to let getRolesInContext() add the owner role to it's return list if the (runtime and proprietary) owner check tells it to. any contraindications (besides performance, possibly)? regards, juergen herrmann ___ XLhost.de - eXperts in Linux hosting Jürgen Herrmann Bruderwöhrdstraße 15b, DE-93051 Regensburg Fon: +49 (0)700 XLHOSTDE [0700 95467833] Fax: +49 (0)721 151 463027 WEB: http://www.XLhost.de ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Hello
Lennart Regebro a écrit : Oh, and another thing: You installed Zope 3.1. Zope 3 is very different from Zope 2, and Plone does not run on it. So, the question is of you want to learn Zope 2 or Zope 3. Which leads to the question: What is your goal with learning Zope? I would like to make small web sites for non profit organizations and I want them to be able to change their sites without knowing html. I want them to be able to publish on the web. I think Plone and Zope seem a good choice. begin:vcard fn:Pierre Thibault n:Thibault;Pierre org;quoted-printable:;D=C3=A9veloppement web et programmation adr;quoted-printable;quoted-printable:;;95B Rose-De-Lima;Montr=C3=A9al;Qu=C3=A9bec;H4C 2L1;Canada email;internet:[EMAIL PROTECTED] title:Programmeur analyste tel;home:(514) 846-9394 note;quoted-printable:Ce que j'aime:=0D=0A= =0D=0A= Les gens intelligents.=0D=0A= La musique.=0D=0A= Les bons vins.=0D=0A= La science.=0D=0A= La litt=C3=A9rature.=0D=0A= Le sport.=0D=0A= Programmer (Java, Python, C++ et cie)=0D=0A= =0D=0A= Ce que je n'aime pas:=0D=0A= =0D=0A= La stupidit=C3=A9.=0D=0A= La futilit=C3=A9 (la mode, regader les spectables sportifs, =C3=A9tendrep= arler des vedettes).=0D=0A= version:2.1 end:vcard ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] __getitem__ and returning a PageTemplateFile instance
Anders Bruun Olsen wrote at 2005-10-20 11:52 +0200: On Wed, Oct 19, 2005 at 09:47:50PM +0200, Dieter Maurer wrote: Zope has encountered a problem publishing your object. Cannot locate object at: http://localhost:8080/vitester/asonhe This is a NotFound problem. Zope is unable to locate vitester/asonhe Are you sure, vitester/asonhe is there? asonhe is not there, but vitester has a __getitem__ method which executes a PageTemplateFile instance and returns it. I.e. Thus, it returns a string. However, ZPublisher requires that all intermediate traversal steps return an object which is not of a simple type and does have a docstring. A string is a simple type, you cannot use it during traversal... return self.test(self, self.REQUEST, value=value) (where self.test is a PageTemplateFile) This results in a string (a simple type)... It actually works if I just do: return self.test.__of__(self) This results in a PageTemplateFile, which has a docstring and is not of simple type. But that way I can't put any values in there. How can I do this then? Can can return a wrapper and give it a docstring. class Wrapper: '''a wrapper around a string.''' # this is the docstring def __init__(self, str): self.str = str def __call__(self): return self.str Some security declarations might be necessary as well. Probably, a class attribute __roles__ = None is sufficient. -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] write file to FS (LocalFS?)
Chris Withers wrote at 2005-10-20 12:03 +0100: ... I would then have this modification done in a tightly controlled external method (from a security point of view) and make sure you use some big Locks (see python threading module's documentation) so multiple simultaneous requests don't cause carnage... Be careful with External Methods and locks: An External Method does not share the module namespace with the same External Methods in other workers. Thus, you should not use locks defined in the source file of the External Method (but outside in a true Python module). -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Hello
On 10/20/05, Pierre Thibault [EMAIL PROTECTED] wrote: Lennart Regebro a écrit : Oh, and another thing: You installed Zope 3.1. Zope 3 is very different from Zope 2, and Plone does not run on it. So, the question is of you want to learn Zope 2 or Zope 3. Which leads to the question: What is your goal with learning Zope? I would like to make small web sites for non profit organizations and I want them to be able to change their sites without knowing html. I want them to be able to publish on the web. I think Plone and Zope seem a good choice. Absolutely. Start with Plone (or for that matter CPS, hint, hint. :-) ) and Zope 2.8.3. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope-DB] Closing idle DCoracle2 Connections?
Germer, Carsten wrote at 2005-10-20 11:16 +0200: ... As we start to use our zope-Ora connection more frequently our database administrator complains that he sees a lot of idle conections. I know theres connection.close() in DCOra2 but does anyone know of a way to autmatically close a DCOra within Zope when idle soandso long? Or any other way to adress such a problem? Modulo bugs, the connection will be closed when the DA object is flushed from the ZODB cache. The ZODB cache is controlled by a maximal size (number of objects) and replaces objects with a least recently used policy. Usually, there is not need for a sophisticated connection management. Just do not create unnecessary DA instances. Modulo bugs, the total number of needed connections is number of DA objects times the number of worker threads. If you see more open connections than this value, you see a bug. Bugs should be fixed and not worked around with more complex software (complex connection management). I know that I wouldn't want the connection being closed from Oracles side as I have read in the mailinglist that DCOracle would still think the connection is open and generate an error. The DA catches OperationalErrors and reopens the connection. It tries to do this transparently (though a bit wrong). -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db