[Zope-CMF] Not allowed to access getMemberById in this context

Kevin Carlson khcarlso@bellsouth.net
Tue, 7 May 2002 23:42:57 -0400


OK, this one was really strange...

I solved the issue by placing all of the code in an external method.
However, I still have a question about permissions and how they work for
anyone who cares to answer.

The method in question, getMemberById, is being called from a another python
script without any problem.  I think the problem could be due to the nature
in which it is called.  The one that works is called from within a dtml
method using the dtml-let tag.  In other words, it is called while a page is
being rendered.  The one that does not work is called from an HTTP POST.

I am having a little trouble understanding this since I am authenticated on
the system either way.  Can anyone enlighten me as to what is going on?

Thanks,

Kevin

-----Original Message-----
From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On Behalf
Of Kevin Carlson
Sent: Tuesday, May 07, 2002 12:02 PM
To: zope-cmf group
Subject: [Zope-CMF] Not allowed to access getMemberById in this context


I've seen errors like this posted in the archives of the list, but haven't
been able to find any solution that will work.  The problem is this:

In a python script I have this code:

	request = container.REQUEST
	RESPONSE =  request.RESPONSE
	portal_properties = context.portal_properties
	portal_membership = context.portal_membership

	id=request.get('id')
	member = portal_membership.getMemberById(id)

	member.setMemberProperties(request)
	container.manage_users(submit="Change",REQUEST=request)

The code is choking on the getMemberById call.  At first I get an
authentication popup asking for username / password but nothing I enter
(including the admin password) will work.  Eventually I get the error
message "Error Value: You are not allowed to access getMemberById in this
context". I find this very odd since I can call getMemberById in a dtml
method.  In fact the DTML method that eventually generates the call to this
python script is calling getMemberById without a problem.

Any ideas?

Thanks,

Kevin




_______________________________________________
Zope-CMF maillist  -  Zope-CMF@zope.org
http://lists.zope.org/mailman/listinfo/zope-cmf

See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
requests