<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Menlo-Regular;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
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;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">The issue doesn’t seem so much one of security (the standard access control on eprints will still stop unauthorised users from accessing
 staff only areas) but rather one of hiding the buttons from those who don’t require them in the pre-built static abstract pages rather than the workflow.&nbsp; This means that you either have to rebuild the pages every time they are requested, which is heavy on
 the server, especially once there are 5 or 6 spiders farming your site, or you use some javascript/jquery to hide or not hide the repository admin access buttons as appropriate.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">It was I who suggested that idea to Andrew on the user group list, with the belief that some aspect of the user profile was available
 in JS.&nbsp; Assuming I was wrong on that front, would the best way to get that detail dynamically be an ajax call to a cgi function to return whether or not the user was an admin and, if not, hide the buttons (possibly requiring a surrounding ‘div’ or some such
 on the elements to be hidden).&nbsp; That way the worst that happens if the script fails or JS is disabled is that the buttons are still visible, as they are currently?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Any thoughts folks?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US">Alan<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
<b>On Behalf Of </b>martin.braendle@id.uzh.ch<br>
<b>Sent:</b> 04 March 2016 09:08<br>
<b>To:</b> eprints-tech@ecs.soton.ac.uk<br>
<b>Subject:</b> [EP-tech] Antwort: Access user via javascript?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Hi,</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">from a point of view of security, I don't think that JavaScript is a good way, since it can be turned off or changed browser side.</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">There is the undocument variable $STAFF_ONLY that can be used in EPScript und EPrints Control Format (EPC).
</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Menlo-Regular&quot;,serif">&lt;epc:if test=&quot;$STAFF_ONLY = 'TRUE'&quot;&gt;</span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">display something here&lt;/epc:if&gt;</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">It is mentioned in </span>
<a href="http://wiki.eprints.org/w/How_to_control_eprint_workflow_based_on_a_user_field"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">http://wiki.eprints.org/w/How_to_control_eprint_workflow_based_on_a_user_field</span></a><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">&nbsp;(in
 the workflow description at the bottom), but not explained there.</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">In my opinion, that variable (and possible other system variables) should be documented in
</span><br>
<br>
<a href="http://wiki.eprints.org/w/EPScript"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">http://wiki.eprints.org/w/EPScript</span></a><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Best regards,</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Martin</span><br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">--</span><br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Dr. Martin Brändle</span><br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Zentrale Informatik</span><br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Universität Zürich</span><br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Stampfenbachstr. 73</span><br>
<span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">CH-8006 Zürich</span><br>
<br>
<br>
<img border="0" width="16" height="16" id="_x0000_i1025" src="cid:image001.gif@01D175F8.6059EBA0" alt="Inactive hide details for Andrew Collington ---01/03/2016 14:16:18---Hi all, Is there something set up in ePrints that allows y"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif;color:#424282">Andrew
 Collington ---01/03/2016 14:16:18---Hi all, Is there something set up in ePrints that allows you to get user details (such as type/role,</span><br>
<br>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#5F5F5F">Von: </span>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">Andrew Collington &lt;<a href="mailto:a.p.collington@sussex.ac.uk">a.p.collington@sussex.ac.uk</a>&gt;</span><br>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#5F5F5F">An: </span>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">&quot;<a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a>&quot; &lt;<a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a>&gt;</span><br>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#5F5F5F">Datum:
</span><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">01/03/2016 14:16</span><br>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#5F5F5F">Betreff:
</span><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif">[EP-tech] Access user via javascript?</span><br>
<span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#5F5F5F">Gesendet von:
</span><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif"><a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a></span><o:p></o:p></p>
<div class="MsoNormal">
<hr size="2" width="100%" noshade="" style="color:#8091A5" align="left">
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
<br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">Hi all,</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">Is there something set up in ePrints that allows you to get user details (such as type/role, email, etc.) via javascript? &nbsp;I did have a look through the auto.js file but didn’t see anything, though
 given the size of that file it’d be very easy for me to miss something obvious!</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">The reason I ask is that I want to show a section in the abstract details only to admins (which is currently set up in cfg/citations/eprint/control.xml). &nbsp;I originally tried to modify that section,
 but with the caching it obviously didn’t work. &nbsp;I then tried to use a pin but had the same problems. &nbsp;Someone responded to my original EPrints UK User Group post (</span><a href="https://groups.google.com/forum/#!topic/eprints-uk-user-group/LloconUdLDg"><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#0563C1">https://groups.google.com/forum/#!topic/eprints-uk-user-group/LloconUdLDg</span></a><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">)
 suggesting that js may be a good way forward.</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">If there’s not something already available then I could update the main template to include a json object of the user details which I can then use later on in the page. &nbsp;But hopefully someone else
 has already tried to add/show content dynamically based on role (or any other user property, I imagine) and can give some advice.</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">Many thanks,</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">Andy</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">-- <br>
Andrew Collington<br>
Web Programmer, ITS Client Services<br>
ITS-CS Shawcross, University of Sussex, Falmer, Brighton, BN1 9QT<br>
<br>
T: (01273) 872591 (ext. 2591)<br>
E: </span><a href="mailto:a.p.collington@sussex.ac.uk"><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">a.p.collington@sussex.ac.uk</span></a><br>
<span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span><tt><span style="font-size:10.0pt">*** Options:
<a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a></span></tt><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><br>
<tt>*** Archive: <a href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a></tt><br>
<tt>*** EPrints community wiki: <a href="http://wiki.eprints.org/">http://wiki.eprints.org/</a></tt><br>
<tt>*** EPrints developers Forum: <a href="http://forum.eprints.org/">http://forum.eprints.org/</a></tt></span><o:p></o:p></p>
</div>
-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England &amp; Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority.
</body>
</html>