<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi John,<br>
<br>
In 3.3, you have triggers, in your context I'd suggest you look at
the
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
EP_TRIGGER_DOC_URL_REWRITE trigger called by Apache::Rewrite.<br>
<br>
Look this up for inspiration:
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="http://bazaar.eprints.org/295/1/epm/coversheets/cfg/cfg.d/z_coversheet_trigger.pl">http://bazaar.eprints.org/295/1/epm/coversheets/cfg/cfg.d/z_coversheet_trigger.pl</a><br>
<br>
Give us a shout if you ran into problems.<br>
<br>
Seb.<br>
<br>
<br>
<br>
On 10/10/13 14:22, John Salter wrote:<br>
</div>
<blockquote
cite="mid:7154BCBB8909D642AE6F44CA713DBC20079099076EB8@HERMES7.ds.leeds.ac.uk"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hi (tried sending this previously, but the
mailing list seemed non-responsive – apologies if you get it
more than once!),<o:p></o:p></p>
<p class="MsoNormal">I’m trying to allow access to thumbnails of
non-public documents.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’ve already added a thumbnail_security
option (all_public, small_public and none_public) to the
documents, and the generated thumbnails now inherit a security
based on this value.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">By default, when a request for a thumbnail
is submitted e.g. <a moz-do-not-send="true"
href="http://repo.ac.uk/123/1.hassmallThumbnailVersion/filename.png">http://repo.ac.uk/123/1.hassmallThumbnailVersion/filename.png</a>,
the HTTP response is based on the security of the parent
document, not the thumbnail document.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">When the request is processed (in
~/archives/ARCHIVEID/cfg/cfg.d/security.pl), the $doc is the
parent document.<o:p></o:p></p>
<p class="MsoNormal">$c->{can_request_view_document} = sub<o:p></o:p></p>
<p class="MsoNormal">{<o:p></o:p></p>
<p class="MsoNormal"> my( $doc, $r ) = @_;<o:p></o:p></p>
<p class="MsoNormal">…<o:p></o:p></p>
<p class="MsoNormal">}<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The $r passed to can_request_view_document
does contain the correct document in
$r->pnotes->{dataobj}, but is there an elegant way of
determining that the request is for a related-document?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This seems to work OK:<o:p></o:p></p>
<p class="MsoNormal">my $tn_doc = $r->pnotes->{dataobj};<o:p></o:p></p>
<p class="MsoNormal">if( defined $tn_doc &&
$tn_doc->get_value( "security" ) eq "public" &&
$status eq "archive" )<o:p></o:p></p>
<p class="MsoNormal">{<o:p></o:p></p>
<p class="MsoNormal"> return( “ALLOW” );<o:p></o:p></p>
<p class="MsoNormal">} <o:p></o:p></p>
<p class="MsoNormal">but it feels a little ‘hacky’. Is there a
better way to achieve this?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
<p class="MsoNormal">John<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">*** Options: <a class="moz-txt-link-freetext" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a class="moz-txt-link-freetext" href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a class="moz-txt-link-freetext" href="http://wiki.eprints.org/">http://wiki.eprints.org/</a>
</pre>
</blockquote>
<br>
</body>
</html>