From ffd44afbe0527a616e8d559002e944df9ac5386d Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 28 Mar 2022 16:43:17 +0000 Subject: [PATCH] Bug 30387: Only allow superlibrarians to set library with IndependentBranches enabled To test: 1. Turn on IndependentBranches. 2. Give a staff member editcatalogue permissions but not superlibrarian permissions. 3. Once logged in as that staff member click on the name in the top right corner, notice that the 'Set library' button is there. 4. Turn on the CircSidebar system preference and go to any page that includes the CircSidebar. ( returns.tt, circulation,tt ). Notcie the Set library button is visibile. 5. Go to '/cgi-bin/koha/circ/set-library.pl', notice you can set your library to something else. 6. Apply patch 7. Again with the staff member who has editcatalogue permissions but not superlibrarian permissions try steps 3-5. This time you should not see the 'Set library' links. On '/cgi-bin/koha/circ/set-library.pl' you should not be able to change your library. 8. With a superlibrarian try steps 3-5, you should see the 'Set library' links and on '/cgi-bin/koha/circ/set-library.pl' you should be able to set your library 9. Turn on 'UseCirculationDesks'. 10. When repeating 3-5 make sure you can see only the 'Set desk' links while logged in as the non-superlibrarian. On '/cgi-bin/koha/circ/set-library.pl' you should only be able to 'Set desk'. 11. Now with a staff member who has neither superlibrarian permissions OR editcatalogue permissions do steps 3-5. You should NOT see the 'Set library links' but you should see the 'Set desk' links. Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Bob Bennhoff --- koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/header.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc index 99b882c76a..cc89395c76 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc @@ -15,7 +15,7 @@ [% IF !Koha.Preference('IndependentBranchesTransfers') || CAN_user_superlibrarian %]
  • Transfer
  • [% END %] - [% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian && !CAN_user_editcatalogue_edit_catalogue ) %] + [% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian ) %] [% IF Koha.Preference('UseCirculationDesks') %]
  • Set library and desk
  • [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 754ac0d294..ffa8cb675b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -149,7 +149,7 @@ [% END %] - [% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian && !CAN_user_editcatalogue_edit_catalogue ) %] + [% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian ) %]
  • [% IF Koha.Preference('UseCirculationDesks') && Koha.Preference('UseCashRegisters') %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt index d89de8b7a3..e94b379d32 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt @@ -81,7 +81,7 @@ Updated:
      [% ELSE %]
      -[% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian && !CAN_user_editcatalogue_edit_catalogue ) %] +[% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian ) %]
      Set library
        -- 2.30.2