EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #10372


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Restrict sepcific editor only upload in specific divisions


CAUTION: This e-mail originated outside the University of Southampton.
Hi John,

I've tried following your suggestions. Here's the explanation:
When creating a user, the Deposit Division screen appears. So I can select which division this user belongs to.
SCR-20260528-ghzl.png
When I try to deposit using the user I created, the Division screen appears as shown below. The division screen is blank.
SCR-20260528-gdco.png
However, during the deposit process, an error appears saying "You haven't filled out the required Divisions field," as shown in the screenshot below.
SCR-20260528-gjef.png

Then I have a question: if I don't select Divisions when depositing, will the Divisions screen be blank on the summary page? It will be assumed that I haven't selected any Divisions. Or will it be automatically saved in the database and appear on the summary page?

Thank you.

Best regards,
Agung Prasetyo W.

On Wed, 27 May 2026 at 22:16, John Salter <J.Salter@leeds.ac.uk> wrote:
CAUTION: This e-mail originated outside the University of Southampton.
CAUTION: This e-mail originated outside the University of Southampton.
Hi Agung,
***NOTE: This IS NOT fully tested***

One way to achieve this is to add a new field to the user, and use that to control the options presented in the deposit workflow.
I wrote this page a while ago that covers a similar thing: https://wiki.eprints.org/w/How_to_control_eprint_workflow_based_on_a_user_field but this doesn't cover using a subject tree to control the options.

If the depositor should only be allowed to deposit in ONE division (or children of it), you could do something like:

  1. Add field to user to control 'deposit' (rather than editorial control)
$c->add_dataset_field( "user",
  {
    name => 'deposit_division',
    type => 'subject',
    top => 'divisions',
    # NB This is NOT multiple.
  }
);

  1. Add phrases for the above field:
    <epp:phrase id="user_fieldname_deposit_division">Deposit division</epp:phrase>
    <epp:phrase id="user_fieldhelp_deposit_division">If the user should only be allowed to depoist under one division, please add it here.</epp:phrase>
  2. Add the above field to the 'user' workflow, so an admin can assign a user to a department e.g. add this to the 'usertype' stage:
    <component><field ref="deposit_division"/></component>
  3. Update the 'eprint' workflow, replacing the existing 'divisions' with something like this, which will restrict the divisions shown if the user profile has a value set. If the user doesn't have the deposit_division field set, all the divisions will be displayed.

    <epc:choose>
      <epc:when test="$current_user{deposit_division}.is_set()">
        <component><field ref="divisions" required="yes" top="{$current_user{deposit_division}.as_string()}" /></component>
      </epc:when>
      <epc:otherwise>
        <component><field ref="divisions" required="yes" /></component>
      </epc:otherwise>
    </epc:choose>

Please let me know if the above works for you (or if you have further questions). If it works, I can add it as an example on the Wiki page linked above.

If a user may need to deposit into multiple divisions at the same level (e.g. Biology and History), this approach won't work.
If you need this, there is probably a way to do it - but it will be a lot more complex!

Cheers,
John


From: eprints-tech-request@ecs.soton.ac.uk <eprints-tech-request@ecs.soton.ac.uk> on behalf of Agung Prasetyo W. <prazetyo@gmail.com>
Sent: Wednesday, May 27, 2026 06:35
To: eprints-tech@ecs.soton.ac.uk <eprints-tech@ecs.soton.ac.uk>
Subject: [EP-tech] Restrict sepcific editor only upload in specific divisions

CAUTION: External Message. Use caution opening links and attachments.

CAUTION: This e-mail originated outside the University of Southampton.
CAUTION: This e-mail originated outside the University of Southampton.
Hi,

I want to restrict Editor "agung" to uploading items only in the "Computer Science" division, while Editor "chandra" can only upload items in the "Biology" division. Meanwhile, the review process is still carried out by a user with Editor privileges.

Here are the rules I use:
$c->{roles}->{"division_depositor"} = [
"-editorial_review",
"-user/edit:owner",
"-user/staff/edit",
"-status",
"-datasets",
"-saved_search",
];

With the above user roles, Editor "agung" can still select other divisions in the workflow details.

Please help.

Thank you.

Best regards,
Agung PW
*** Options: https://wiki.eprints.org/w/Eprints-tech_Mailing_List
*** Archive: https://www.eprints.org/tech.php/
*** EPrints community wiki: https://wiki.eprints.org/