From: Laurence R. <l...@lr...> - 2004-11-29 19:48:07
|
Hi, (Note, I am using CMFEditions from CVS today and ZopeVersionControl and CMFUid from collective tarballs) investigating a little further, I see that my earlier permissions problems viewing versions_history_form stems from this starting on line 58 <tr tal:repeat="logentry python:here.portal_versions.getHistory(here)"> <td> <input type="checkbox" value="" name="compare_ids:list" value="" tal:attributes="value logentry/version_id" tal:condition="not:repeat/logentry/start"/> </td> <td> <span tal:content="logentry/version_id">1</span> getHistory returns a series of ZVC EventLog.LogEntry objects. But this class does not have `__allow_access_to_unprotected_subobjects__ = 1` so the accessing of version_id fails. What are the implications of allowing unrestrived access? It's doc string says: """A LogEntry contains audit information about a version control operation. Actions that cause audit records to be created include checkout and checkin. Log entry information can be read (but not changed) by restricted code.""" but I don't see how restricted code could ever have access to subobjects it creates at init. # These action constants represent the possible auditable actions. ACTION_CHECKOUT = 0 ACTION_CHECKIN = 1 ACTION_UNCHECKOUT = 2 ACTION_UPDATE = 3 def __init__(self, version_id, action, path=None, message=''): self.timestamp = time.time() self.version_id = version_id self.action = action self.message = message self.user_id = _findUserId() self.path = path Anyway, If I set that, I can see the versions_history form. yay! :-) Now clicking on a version gives another attribute error about 'base'. Removing the unused base_macros definition from versions_history_form seems to fix this. But now I get TypeErrrors on 'len() of unsized object' and removing all it's len() functions makes no effect and the traceback is confusing me. Traceback (innermost last): Module ZPublisher.Publish, line 101, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Shared.DC.Scripts.Bindings, line 306, in __call__ Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module Products.PageTemplates.ZopePageTemplate, line 222, in _exec Module Products.PageTemplates.PageTemplate, line 96, in pt_render - <ZopePageTemplate at /plone/versions_history_form used for /plone/test.doc> Module TAL.TALInterpreter, line 189, in __call__ Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 670, in do_useMacro Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 408, in do_optTag_tal Module TAL.TALInterpreter, line 393, in do_optTag Module TAL.TALInterpreter, line 388, in no_tag Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 701, in do_defineSlot Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 408, in do_optTag_tal Module TAL.TALInterpreter, line 393, in do_optTag Module TAL.TALInterpreter, line 388, in no_tag Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 649, in do_defineMacro Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 693, in do_defineSlot Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 636, in do_condition Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 408, in do_optTag_tal Module TAL.TALInterpreter, line 393, in do_optTag Module TAL.TALInterpreter, line 388, in no_tag Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 408, in do_optTag_tal Module TAL.TALInterpreter, line 393, in do_optTag Module TAL.TALInterpreter, line 388, in no_tag Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 660, in do_useMacro Module TAL.TALDefs, line 152, in isCurrentVersion Module TAL.TALDefs, line 165, in getProgramVersion TypeError: len() of unsized object Any clues anyone? regards, Laurence |