EPrints Technical Mailing List Archive

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

Message: #10217


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

Re: [EP-tech] How to remove "remove item (with notification)" button

  • To: David R Newman <drn@ecs.soton.ac.uk>
  • Subject: Re: [EP-tech] How to remove "remove item (with notification)" button
  • From: "Agung Prasetyo W." <prazetyo@gmail.com>
  • Date: Wed, 27 Aug 2025 16:21:18 +0700

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

Thank you for your explanation. I will keep these notes for me. 

Best regards,
Agung PW

On Wed, 27 Aug 2025 at 16:18, David R Newman <drn@ecs.soton.ac.uk> wrote:

Hi Agung,

Although you can add an extra role like that the anti-privileges in that role are not all correct, you would need the following to prevent any eprint items from being deleted:

$c->{roles}->{"anti-privileges"} = [ qw{
    -eprint/destroy
    -eprint/inbox/destroy:owner   
    -eprint/inbox/remove:owner
    -eprint/buffer/remove_with_email:editor
    -eprint/inbox/remove_with_email:editor
}];

I am not sure if the "-eprint/inbox/destroy:owner" is actually needed or is covered by "-eprint/destroy".  "destroy" relate to the CRUD (REST-like) API rather than the web-based user interface, which also uses "remove". You may also need to add "-eprint/archive/remove" depending on the version of EPrints you are running.

Regards

David Newman

On 27/08/2025 10:01, Agung Prasetyo W. wrote:
CAUTION: This e-mail originated outside the University of Southampton.
Hi David,

I want to restrict access for both administrators and editors. Why can't I do this in my repository? Do I have to log out and log back in?
$c->{roles}->{"anti-privileges"} = [
"-eprint/inbox/destroy:owner",
"-eprint/inbox/remove:owner",
"-eprint/inbox/remove_with_email:owner",
"-eprint/remove_with_email",
];
Of the four lines above, which part removes the "remove (with notification)" button?

I'll try again.

Thank you.

Best regards,
Agung PW




On Wed, 27 Aug 2025 at 15:34, David R Newman <drn@ecs.soton.ac.uk> wrote:

Hi Agung,

This worked fine for me.  Did you make sure you added these "anti-privileges" to both of the following in user_roles.pl:

$c->{user_roles}->{editor}
$c->{user_roles}->{admin}

If you created any other user types that have the 'editor' role, then you will also need to make sure you add these "anti-privileges"  to that set of user rolles as well.  If you did add all these anti-privileges you listed to all relevant sets of user roles, then possibly these are being overridden by another user_roles.pl. (Maybe you edited lib/cfg.d/user_roles.pl whilst there is an archives/ARCHIVE_ID/cfg/cfg.d/user_roles.pl). It is possible that another cfg.d file resets the user roles for some reason, (nothing in the default codebase does this), which means these anti-privileges get lost.

Also, I think you only need the remove_with_email permissions in your list unless you want to disable users from deleting items (without notification) that they created and have not been submitted for review or moved to the live archive.

Regards

David Newman

On 27/08/2025 04:35, Agung Prasetyo W. wrote:
CAUTION: This e-mail originated outside the University of Southampton.
CAUTION: This e-mail originated outside the University of Southampton.
Hi,

I'd like to ask how to remove the "Remove Item (With Notification)" button when on deposit process?
WhatsApp Image 2025-08-27 at 10.28.12.jpeg
I've added several options to user_roles.pl, but it still doesn't work. I'm not sure if the options below are correct or not.
-eprint/inbox/remove_with_email:editor
-eprint/buffer/remove_with_email:editor
-eprint/inbox/remove:owner

Need your 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/