Re: [Zope-dev] skinscript and URL traversal question
At 09:38 AM 1/19/01 -0500, Phillip J. Eby wrote:
This is probably a permissions issue. During __bobo_traverse__, the user has not yet been authenticated, and is effectively anonymous.
I was logged in as a manager.
That would not make any difference. As I said, when __bobo_traverse__ is called, nobody is "logged in", because Zope hasn't gotten around to checking who you are yet.
Thus, your SkinScript is running as anonymous, and probably doesn't have rights to access the SQL method. You might need to change the proxy roles setting on the SkinScript method so that when the SkinScript runs it always has appropriate roles to do what it needs to do.
I gave the skinscript trigger a proxy role of manager. Actually, I gave all methods involved a proxy of manager. The same error was produced.
What version of Zope are you using?
Zope version: Zope 2.2.1 Platform: freebsd4
At 09:41 AM 1/19/01 -0500, Aaron Payne wrote:
At 09:38 AM 1/19/01 -0500, Phillip J. Eby wrote:
Thus, your SkinScript is running as anonymous, and probably doesn't have rights to access the SQL method. You might need to change the proxy roles setting on the SkinScript method so that when the SkinScript runs it always has appropriate roles to do what it needs to do.
I gave the skinscript trigger a proxy role of manager. Actually, I gave all methods involved a proxy of manager. The same error was produced.
What version of Zope are you using?
Zope version: Zope 2.2.1 Platform: freebsd4
Hmm. You've got me, then. Have you tried taking the Python Method out of the mix and using the SQL method directly, like this: WITH QUERY searchBy_Name(name=self.id) Also, have you tried running Zope with logging ("STUPID_LOG_FILE") enabled? What gets added to the log when you try to access the object via bobo_traverse?
Hi all, A solution has been found. woohoo. A not found error was produced with direct URL traversal. Steve Spicklemire sent this solution off list. The process is split into two steps: Do the query to 'load the object on traversal': WITH QUERY searchBy_Name(name=self.id) COMPUTE name Do the query to 'load the attributes needed for rendering a particular document': WITH QUERY searchByNameCheck(self.id) COMPUTE username,coupon_text,categorylist,categoryheader,expirationdate,status,couponterms During traversal AUTHENTICATED_USER is not yet defined, so it's no good trying to get to it. However, once authentication has happened (after Zope has sorted out what object you're after an imposed security on the object..) then it should be OK. Since the Storage tab uses 'name' to load the object, we can't access AUTHENTICATED_USER before loading 'name', but the other attributes are OK. -Aaron
participants (2)
-
Aaron Payne -
Phillip J. Eby