Greetings Zopistas! Currently, I'm having problems with a python script. Let me describe the situation. I have a product (Member) which has a number of properties. These properties are themselves instances of a Property class. The Property class only has getValue() and setValue() methods. Thus, in order to get the member's first name, I can use the following syntax: myMember.fname.getValue() The getValue() method is declared as public with the following syntax: security = ClassSecurityInfo() security.declarePublic('getValue') def getValue(self): """returns the value of this property""" return self.value I can call the fname.getValue() method from another method of my member object. The problem is that when I attempt to call the fname.getValue() method from a python script, I am prompted for my password and then am given an error: "Unauthorized: getValue" I think that I'm missing something important related to python script security, but haven't been able to determine what it is. Any help would be MOST appreciated. Thanks in advance, Keith R. Alperin
Keith Alperin wrote:
security = ClassSecurityInfo() security.declarePublic('getValue') def getValue(self): """returns the value of this property""" return self.value
If you haven't already, read http://dev.zope.org/Wikis/DevSite/Projects/DeclarativeSecurity/ZopeSecurityF..., in particular the example right before the paragraph that starts with: "Note the last line in the example. In order for security assertions to be correctly applied to your class, you must call the global class initializer for all classes that have security information." Hopefully this will solve your problem. Cheers, Evan @ Zope
Keith Alperin writes:
... myMember.fname.getValue() ... I can call the fname.getValue() method from another method of my member object. The problem is that when I attempt to call the fname.getValue() method from a python script, I am prompted for my password and then am given an error: "Unauthorized: getValue" Are both "myMember" and "myMember.fname" instances of an "Acquisition.[Im|Ex}plicit" class?
Dieter
participants (3)
-
Dieter Maurer -
Evan Simpson -
Keith Alperin