Bug 32976 - Patron image Add/Edit button should not appear if permission is turned off
Summary: Patron image Add/Edit button should not appear if permission is turned off
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-15 21:55 UTC by Christopher Brannon
Modified: 2023-12-28 20:44 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.05
Circulation function:


Attachments
Bug 32976: Add permission check on Add/Edit controls for patron images (3.23 KB, patch)
2023-02-26 11:24 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 32976: Add permission check on Add/Edit controls for patron images (3.28 KB, patch)
2023-02-27 14:53 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 32976: Add permission check on Add/Edit controls for patron images (3.34 KB, patch)
2023-02-27 17:45 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 32976: Add permission check on Add/Edit controls for patron images (3.42 KB, patch)
2023-03-24 09:01 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Brannon 2023-02-15 21:55:31 UTC
If you don't have permission to upload images, you still see the add/edit button for the patron image.  It does nothing when clicked, but it really shouldn't be visible at all.
Comment 1 Katrin Fischer 2023-02-26 11:24:42 UTC
Created attachment 147420 [details] [review]
Bug 32976: Add permission check on Add/Edit controls for patron images

This adds a check on the batch_upload_patron_images permission
to the Add/Edit control for patron images in the patron account
in the staff interface.

To test:
* Enable patronimages system preference
* With your 'superlibrarian' account:
* Add and edit/remove a patron image to an account
* Create a staff user with batch_upload_patron_images permission
* Log in with this user and verify everything works the same
  as before
* Remove the batch_upload_patron_images permission
* Verify the Add/Edit controls are on longer visible to this
  patron
Comment 2 Owen Leonard 2023-02-27 14:53:03 UTC
Created attachment 147446 [details] [review]
Bug 32976: Add permission check on Add/Edit controls for patron images

This adds a check on the batch_upload_patron_images permission
to the Add/Edit control for patron images in the patron account
in the staff interface.

To test:
* Enable patronimages system preference
* With your 'superlibrarian' account:
* Add and edit/remove a patron image to an account
* Create a staff user with batch_upload_patron_images permission
* Log in with this user and verify everything works the same
  as before
* Remove the batch_upload_patron_images permission
* Verify the Add/Edit controls are on longer visible to this
  patron

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Biblibre Sandboxes 2023-02-27 17:45:39 UTC
Created attachment 147462 [details] [review]
Bug 32976: Add permission check on Add/Edit controls for patron images

This adds a check on the batch_upload_patron_images permission
to the Add/Edit control for patron images in the patron account
in the staff interface.

To test:
* Enable patronimages system preference
* With your 'superlibrarian' account:
* Add and edit/remove a patron image to an account
* Create a staff user with batch_upload_patron_images permission
* Log in with this user and verify everything works the same
  as before
* Remove the batch_upload_patron_images permission
* Verify the Add/Edit controls are on longer visible to this
  patron

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Comment 4 Katrin Fischer 2023-02-27 18:46:16 UTC
Thx Owen and Christopher!
Comment 5 Jonathan Druart 2023-03-24 09:01:55 UTC
Created attachment 148638 [details] [review]
Bug 32976: Add permission check on Add/Edit controls for patron images

This adds a check on the batch_upload_patron_images permission
to the Add/Edit control for patron images in the patron account
in the staff interface.

To test:
* Enable patronimages system preference
* With your 'superlibrarian' account:
* Add and edit/remove a patron image to an account
* Create a staff user with batch_upload_patron_images permission
* Log in with this user and verify everything works the same
  as before
* Remove the batch_upload_patron_images permission
* Verify the Add/Edit controls are on longer visible to this
  patron

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Tomás Cohen Arazi (tcohen) 2023-04-03 10:30:19 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 7 Jacob O'Mara 2023-04-16 17:24:30 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.