Bugzilla – Attachment 60228 Details for
Bug 10679
Lists interface offers delete option when user doesn't have permission
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10679: Hide delete option for lists if user does not have permission
Bug-10679-Hide-delete-option-for-lists-if-user-doe.patch (text/plain), 1.73 KB, created by
Aleisha Amohia
on 2017-02-15 01:03:18 UTC
(
hide
)
Description:
Bug 10679: Hide delete option for lists if user does not have permission
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-02-15 01:03:18 UTC
Size:
1.73 KB
patch
obsolete
>From 044ee24372a8ad16a676c00f77d20a53b00a62c2 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 15 Feb 2017 00:56:26 +0000 >Subject: [PATCH] Bug 10679: Hide delete option for lists if user does not have > permission > >The reason the delete button was still showing is because, by default, >we allow anyone to remove THEIR OWN contributions from a list. So, the >delete button will always show. This patch makes sure that the delete >button will only show if permission for anyone else to add or delete >their own entries is granted. > >To test: >1) Make a public list setting all permissions to 'do not allow' EXCEPT >'remove own contributed entries' (set this to Allow). This should be >done by default, but just make sure >2) Log in as a different user and go to that list. notice the 'remove >selected' button shows, but attempting to delete any records fails. >3) Apply patch and refresh the page >4) Notice that the delete button is now gone. >5) Log back in as the list owner and set the first two permissions to >'Allow' (add entries, remove their own contributed entries) >6) Log back in as a different user and go to the list. The delete button >should now be showing and work as expected. > >Sponsored-by: Catalyst IT >--- > Koha/Virtualshelf.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Virtualshelf.pm b/Koha/Virtualshelf.pm >index 4e45c31..b1a8793 100644 >--- a/Koha/Virtualshelf.pm >+++ b/Koha/Virtualshelf.pm >@@ -271,7 +271,7 @@ sub can_biblios_be_removed { > return 1 > if $borrowernumber > and ( $self->owner == $borrowernumber >- or $self->allow_delete_own >+ or ( $self->allow_delete_own and $self->allow_add ) > or $self->allow_delete_other ); > return 0; > } >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10679
:
60228
|
60364