EPrints Technical Mailing List Archive

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

Message: #10370


< 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 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:

$c->add_dataset_field( "user",
  {
    name => 'deposit_division',
    type => 'subject',
    top => 'divisions',
    # NB This is NOT multiple.
  }
);

  1. <component><field ref="deposit_division"/></component>

    <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