Product Creation and Permission
Hey there, I have a question regarding the use of permissions in Classes, regarding the creation of user-made Products for Zope. The product that I have is made from 2 classes, which for this example I will call classes A and B. From the management screen of Class A after you create a instance of it in Zope, it shows a list from a external database of instances of B. B does not get into the Zope Database at all. A's code has been modified in the manage_menu system such that it can add and subtract instances of B from the external database. It does this just fine. When selecting a instance of B (let's call it C), from the management menu of A, I keep getting asked to enter my password and can never get in, eventually getting it to say that I don't have permission to manage it or view it. I tried adding: security = ClassSecurityInfo() security.declareObjectPublic() security.setDefaultAccess('allow') security.__allow_access_to_unprotected_subobjects__ = 1 ... but it seemed to only grant me access to the index_html, bouncing me down to a lower level other than management. I think the problem is that Zope doesn't see B very well and I need to tell it how to manage it. Does anyone have any ideas how I can take this B object and give it access privledges so that I can manage it? I tried tinkering with __ac_permissions__ but I got locked out even further, not even index_html would come up. :) Any thoughts? Thanks. Jason ____________________________________________________________________ Get free email and a permanent address at http://www.netaddress.com/?N=1
Jason Joy wrote:
Hey there, I have a question regarding the use of permissions in Classes, regarding the creation of user-made Products for Zope.
The product that I have is made from 2 classes, which for this example I will call classes A and B. From the management screen of Class A after you create a instance of it in Zope, it shows a list from a external database of instances of B. B does not get into the Zope Database at all. A's code has been modified in the manage_menu system such that it can add and subtract instances of B from the external database. It does this just fine.
When selecting a instance of B (let's call it C), from the management menu of A, I keep getting asked to enter my password and can never get in, eventually getting it to say that I don't have permission to manage it or view it. I tried adding:
security = ClassSecurityInfo() security.declareObjectPublic() security.setDefaultAccess('allow') security.__allow_access_to_unprotected_subobjects__ = 1
[snip] Your last line is close, add the class attribute: __allow_access_to_unprotected_subobjects__ = 1 to the class definition in A. This tells zope to allow access to subobjects TTW which is prohibited by default. hth, -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
participants (2)
-
Casey Duncan -
Jason Joy