EPrints Technical Mailing List Archive
Message: #08275
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] Setting editorial scope by roles
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>, "Robin Sylvestre" <robin.sylvestre@polymtl.ca>
- Subject: Re: [EP-tech] Setting editorial scope by roles
- From: John Salter <J.Salter@leeds.ac.uk>
- Date: Thu, 30 Jul 2020 22:34:14 +0000
Hi Robin, You can add additional fields to control the user review scope by adding them to the copy of this: https://github.com/eprints/eprints/blob/3.3/lib/defaultcfg/cfg.d/user_review_scope.pl in archives/ARCHIVEID/cfg/cfg.d/ I think you might need to add any field that you want to use in the editperms to that first. Then, construct a search object with the fields/values you want, and use the $search->serialise method. Remember that editperms is a multiple field - so it's an array that you can push the value on to. *** ENTIRELY UNTESTED - hopefully enough to get you sorted though *** my $ds = $session->dataset( "eprint" ); my $searchexp = $ds->prepare_search(); $searchexp->add_field( fields => [ $ds->field( 'userid' ), ], value => 100, match => "EX", ); push @{$user->value( "editperms" )}, $searchexp->serialise; Cheers, John From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Robin Sylvestre via Eprints-tech Hello friends of EPrints, Does anybody know how to set editorial scope based on a user role? I don’t think there’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 ($repo->current_user->{editperms}
) on login and I can’t find the correct syntax. I’ve looked in the documentation for an example how to set this variable and I can’t find much. It should be close to a search equation but it’s stored in the database in the form of
0|1||eprint|-|type:type:ANY:EQ:article|-| . How do I translate that into an array?
Looking forward for your advice. Robin Sylvestre Technicien des systèmes informatisés |
- Follow-Ups:
- Re: [EP-tech] Setting editorial scope by roles
- From: John Salter <J.Salter@leeds.ac.uk>
- Re: [EP-tech] Setting editorial scope by roles
- References:
- [EP-tech] Setting editorial scope by roles
- From: Robin Sylvestre <robin.sylvestre@polymtl.ca>
- Re: [EP-tech] Setting editorial scope by roles
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] Setting editorial scope by roles
- Prev by Date: Re: [EP-tech] EP 3.4.1 + pub flavour doesn't export <item_issues>
- Next by Date: Re: [EP-tech] .docx Export
- Previous by thread: [EP-tech] Sort view with creators_name and corp_creators
- Index(es):