<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:x="urn:schemas-microsoft-com:office:excel" 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=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<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;}
/* 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:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle18
        {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 90.0pt 72.0pt 90.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="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi Robin,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">You can add additional fields to control the user review scope by adding them to the copy of this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2F3.3%2Flib%2Fdefaultcfg%2Fcfg.d%2Fuser_review_scope.pl&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C87a80fc099e14dc2e96708d834d8b21c%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=vzCnKXyCx%2BgecIo5oV2IzrbuOfUk0BoxF8ZvFlkg9Wc%3D&amp;reserved=0" originalSrc="https://github.com/eprints/eprints/blob/3.3/lib/defaultcfg/cfg.d/user_review_scope.pl" shash="VXoOzZ1e1V3n89SIPT/Q4hHcwHXOoaFMTY3Guj81UQ306Gp1YL1tXWqhLBDrGbKjMT3GpGhadIF79Tai3e3fJHoAcrFBnWaDU77VvF3DSeMHloXTaRt0jo6YjA++Uk875TQxcKFm5cVTrrCfI3AD/voMubnPI6BBzot3mr4sXCY=">https://github.com/eprints/eprints/blob/3.3/lib/defaultcfg/cfg.d/user_review_scope.pl</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">in archives/ARCHIVEID/cfg/cfg.d/<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I think you might need to add any field that you want to use in the editperms to that first.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Then, construct a search object with the fields/values you want, and use the $search-&gt;serialise method.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Remember that editperms is a multiple field - so it's an array that you can push the value on to.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">*** ENTIRELY UNTESTED - hopefully enough to get you sorted though ***<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">my $ds = $session-&gt;dataset( &quot;eprint&quot; );<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">my $searchexp = $ds-&gt;prepare_search();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">$searchexp-&gt;add_field(<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">&nbsp;&nbsp;&nbsp; fields =&gt; [<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ds-&gt;field( 'userid' ),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">&nbsp;&nbsp;&nbsp; ],<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">&nbsp;&nbsp;&nbsp; value =&gt; 100, <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;match =&gt; &quot;EX&quot;,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">push @{$user-&gt;value( &quot;editperms&quot; )}, $searchexp-&gt;serialise;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">John<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><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="mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-GB"> eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
<b>On Behalf Of </b>Robin Sylvestre via Eprints-tech<br>
<b>Sent:</b> 30 July 2020 05:44<br>
<b>To:</b> eprints-tech@ecs.soton.ac.uk<br>
<b>Subject:</b> [EP-tech] Setting editorial scope by roles<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span lang="EN-CA">Hello friends of EPrints,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Does anybody know how to set editorial scope based on a user role? I don&#8217;t think there&#8217;s a native way to add them with roles, but based on a role given to a user I would like to assign editperms to the current user (<b>$repo-&gt;current_user-&gt;{editperms}
 ) </b>on login and I can&#8217;t find the correct syntax. I&#8217;ve looked in the documentation for an example how to set this variable and I can&#8217;t find much. It should be close to a search equation but it&#8217;s stored in the database in the form of
<b>0|1||eprint|-|type:type:ANY:EQ:article|-| </b>. How do I translate that into an array?
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Looking forward for your advice.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="FR-CA" style="font-size:16.0pt;color:#BF8F00;mso-fareast-language:FR-CA">Robin Sylvestre</span></b><span lang="FR" style="font-size:12.0pt;mso-fareast-language:FR-CA"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="FR-CA" style="mso-fareast-language:FR-CA">Technicien des systèmes informatisés<br>
</span></b><span lang="FR-CA" style="mso-fareast-language:FR-CA">Bibliothèque Louise-Lalonde-Lamarre<br>
Polytechnique Montréal<br>
514-340-4711 poste 5973</span><span lang="FR" style="mso-fareast-language:FR-CA"><o:p></o:p></span></p>
</div>
</body>
</html>