[Zope] HELP! Misunderstanding of permissions?
Sidnei da Silva
sidnei@x3ng.com.br
Fri, 19 Oct 2001 12:07:20 -0200
--------------Boundary-00=_8WHGVUX0TWJ45W35W6TZ
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Well, I did it, and it not worked, but helped me to clarify the things a
little more and to discover the REAL cause of the problem. No to mention that
helped me to improve the code of my product. THANX CASEY!!!!!
But now, the real thing:
I noticed that the problem wasnt this product but another, that was put in
the aquisiton chain by an access rule.
This product contains a modified __bobo_traverse__ that i have copied from
the "Mirrowing Folder", by Dieter Maurer. Because i just copied the code,
without understanding what it is doing, i dont know how to fix, but i think
that the line that says "unrestrictedTraverse" has something to do with the
case. Any help?
Thanx for the help again.
Em Friday 19 October 2001 11:43, Casey Duncan escreveu:
> On Friday 19 October 2001 09:28 am, Sidnei da Silva allegedly wrote:
> > Hello everyone,
> >
> > In First Place, I hope that someone answer my questions this time. Im
> > very disappointed with this list, because people spend time discussing
> > things like if zope is good or not good and do not answer simple
> > questions of people that is trying to learn how to use zope in a simple
> > way.
> >
> > I need help on something that seems pretty strange to me:
> >
> > I'm developing a product in python, and everything its working fine,
> > except that when i try to access any object of type File, i get an
> > Unauthorized Error. Any other object that i try to access works fine. I
> > tried to move the file object out of my Custom object, and then i can
> > access it without any problem. So, the only thing that can be wrong is my
> > product.
> >
> > I have attached the code of my product for your viewing.
> >
> > Thanx.
>
> Although I am not 100% sure this will work, it is a simple change and worth
> a try:
>
> Change the declaration "filtered_meta_types" to "all_meta_types". See if
> that helps.
>
> Also, I notice you have a lot of redundant base classes. I think
> OFS.Folder.Folder alone would suffice. Sometimes the order of these makes a
> difference. Try using just the single base class.
>
> hth,
> /---------------------------------------------------\
> Casey Duncan, Sr. Web Developer
> National Legal Aid and Defender Association
> c.duncan@nlada.org
> \---------------------------------------------------/
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
--
Sidnei da Silva
X3ng Consultoria e Desenvolvimento Ltda.
sidnei@x3ng.com.br
--------------Boundary-00=_8WHGVUX0TWJ45W35W6TZ
Content-Type: text/plain;
charset="iso-8859-1";
name="XTemplate.py"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="XTemplate.py"
aW1wb3J0IEdsb2JhbHMKZnJvbSBHbG9iYWxzIGltcG9ydCBQZXJzaXN0ZW50LCBBY3F1aXNpdGlv
bgppbXBvcnQgQWNjZXNzQ29udHJvbAppbXBvcnQgT0ZTCmltcG9ydCBzeXMKZnJvbSBBY2Nlc3ND
b250cm9sIGltcG9ydCBDbGFzc1NlY3VyaXR5SW5mbwoKY2xhc3MgWFRlbXBsYXRlICgKICAgIEFj
cXVpc2l0aW9uLkltcGxpY2l0LAogICAgUGVyc2lzdGVudCwKICAgICNBY2Nlc3NDb250cm9sLlJv
bGUuUm9sZU1hbmFnZXIsCiAgICAjT0ZTLlByb3BlcnR5TWFuYWdlci5Qcm9wZXJ0eU1hbmFnZXIs
CiAgICAjT0ZTLk9iamVjdE1hbmFnZXIuT2JqZWN0TWFuYWdlciwKICAgIE9GUy5Gb2xkZXIuRm9s
ZGVyCiAgICApOgogICAgIkNsYXNzZSBxdWUgZGVmaW5lIG8gWFRlbXBsYXRlLiIKCiAgICBkYXRh
X2luaWNpYWwgPSAiMTk3MC8wMS8wMSIKICAgIGRhdGFfZmluYWwgPSAiMjEwMC8wMS8wMSIKCiAg
ICBhbGxfbWV0YV90eXBlcyA9ICgKICAgICAgICAgICAgICAgICAgICAgICAgeyduYW1lJyA6ICdG
b2xkZXInLCAnYWN0aW9uJyA6ICdtYW5hZ2VfYWRkUHJvZHVjdC9PRlNQL2ZvbGRlckFkZCd9LAog
ICAgICAgICAgICAgICAgICAgICAgICB7J25hbWUnIDogJ0ZpbGUnLCAnYWN0aW9uJyA6ICdtYW5h
Z2VfYW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