[z3-five] objects, security,etc

kevin7kal plone at kevinkal.com
Wed Jul 19 14:38:28 CEST 2006


I'm still having issues with this.  I have tried adding
<class class="class.class1">
<require permission="zope2.View" attributes="attribute1 attribute2" />
</class>
and continue to recieve unauthorized error.  I can create a my 'zclass' 
and do something like
test=context.zclass.method2
print test
return printed

but continue to recieve unauthorized errors when I try to access the 
attributes
print test.attribute1

I have tried to have class1 inherit from Aquisition.Explicit as well and 
still cannot access this object.

Any suggestions are appreciated.

kevin7kal wrote:
> I should mention, this is zope 2.9.3
>
>
> kevin7kal wrote:
>   
>> I am attempting to bring a new object class into zope five and having 
>> some issues that hopefully someone can help with.
>> Here is a simple example of my situation.
>> I have class.py,zclass.py
>> class.py
>>
>> class1(object):
>>    '''a simple class''''
>>     attribute1='a string''
>>     attribute2='another string'
>>
>> class2(object):
>>      def __init__(self,value1,value2):
>>      
>>      def method1():
>>      print somemethod
>>
>>      def method2():
>>      returnobject = class1()
>>      return returnobject
>>
>> zclass.py
>> import class
>>
>> zclass2(SimpleItem,class.class2):
>> """"doctstring""""
>>     implements(Izclass2)
>>      def __init__(self,,tmpID='',tmpTITLE='')
>>      return
>>
>> I have all of the interface things done and the all classes in class.py 
>> are five traversable.
>> I can use class2.method1 with no problems, but class2.method2 returns a 
>> class1 object.  The problem is when I try to access any methods or 
>> attributes on the class1 object that is returned, I have permission 
>> denied.  How can I make it so the methods and attributes of this object 
>> are accessable?
>>
>> _______________________________________________
>> z3-five mailing list
>> z3-five at codespeak.net
>> http://codespeak.net/mailman/listinfo/z3-five
>>
>>   
>>     
> _______________________________________________
> z3-five mailing list
> z3-five at codespeak.net
> http://codespeak.net/mailman/listinfo/z3-five
>
>   


More information about the z3-five mailing list