[Zope-CMF] portal_catalog and DateTime wierdness (was: RE: [Zope-dev] ZCatalog search permission problem)

Bjorn Stabell bjorn@exoweb.net
Sun, 11 Nov 2001 19:50:28 +0800


I'm replying to my own mail as I've gotten a little bit further in the
troubleshooting, but I'm stuck again.  The permission missing is "Access
inactive portal content" and it is required because the expires search
that CMFCore.CatalogTool.searchResults does fails.

All content has expires =3D DateTime('9998/12/31')

Returns no content:
	portal_catalog.searchResults(expires=3D_.DateTime(),
expires_usage=3D'range:min')
	[ expires =3D DateTime('2001/11/11 00:15:50.4 GMT+8') ]

Returns all content:
=09
portal_catalog.searchResults(expires=3D_.DateTime().earliestTime(),
expires_usage=3D'range:min')
	[ expires =3D DateTime('2001/11/11') ]

Very wierd; so it's only when the DateTime object has some hours, minute
or seconds-part that I run into trouble.  Even if the FieldIndex
(expires is a FieldIndex, btw) converted the expires() to a string
(which it doesn't since _.repr() on the expires meta data gives
DateTime(blabla)), the sorting and less-than / greater-than comparision
should work.

Anybody got a clue?

Bye,
--=20
Bjorn

> -----Original Message-----
> From: Bjorn Stabell=20
> Posted At: Sunday, November 11, 2001 18:18
> Posted To: Zope Developer
> Conversation: [Zope] Concatenation
> Subject: [Zope-dev] ZCatalog search permission problem
>=20
>=20
> Hi all,
>=20
> I'm using Zope 2.4 with DC Workflow 0.4 and recently I made some
> permissions and role changes that I think messed up the=20
> ZCatalog search.
> Right now, as Anonymous, searchResults() returns no matches. =20
> Looking at
> the portal_catalog (I'm using CMF) almost all content has
> allowedUsers]AndRoles that looks like this:
>=20
> 	 ['Writer', 'user:bjorn', 'Reviewer', 'Anonymous', 'Editor',
> 'Authenticated', 'Manager', 'Member'] =20
>=20
> I even made a program, dumpPerm() that dumps the permission=20
> settings on
> an object for the current user (see below): it shows that=20
> Anonymous has
> View permission on all content.  Effective date is in the past, expire
> date in the future.  Still, nothing shows up in searchResults().  I've
> recataloged and recataloged, but to no avail.
>=20
> Help, please....???????
>=20
> Regards,
> --=20
> Bjorn
>=20
>=20
> ----
>=20
> # used as External method
>=20
> def dumpPerm(self):
>     """ Dump all permissions this user has on this object """
>=20
>     user =3D self.REQUEST.AUTHENTICATED_USER
>     resp =3D self.REQUEST.RESPONSE
>=20
>     resp.setHeader('Content-type', 'text/plain')
>     resp.write("Permission settings for "+str(user)+" on
> "+str(self.id)+"\r\n\n")
>=20
>     for perm in self.permission_settings():
>          if user.has_permission(perm['name'], self):
>              resp.write(" "+str(perm['name'])+"\r\n")
>          else:
>              resp.write("("+str(perm['name'])+")\r\n")
>=20
>=20
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
>=20