Comment 2 for bug 109007

Revision history for this message
Andy Altepeter (aaltepet) wrote :

ok, I found the problem. The lastauthor metadata field's TALES default expression is:
python:content.sec_get_last_author_info().fullname()

Version objects don't inherit the Silva Security class, VersionedContent does. So, while 'content' may be the published version, sec_get_last* is part of Document. This method gets the previewable (editable) version's last author info.

Not quite sure how to fix this without doing some major changes. Here are a few options. Recall the lastauthorinfo is actually stored on the Version, so:
1) implement a VersionSecurity class, which Version inherits, and contains implementations for the Version. We'd need to audit the Security class to determine which ones to override with version implementations, or perhaps add sec_get_version_last_author_info and such. I'm not sure I like either of these possibilities.
2) add a 'version' parameter to Security.sec_get_last_author_info. The version could be the version id, or a version object, or a string representing which version (last_closed, published, editable, previewable, etc). The metadata field TALES could be changed to:
python:content.sec_get_last_author_info().fullname(version=content.id)