Bug 2426: Remove deprecated management permission
authorKatrin Fischer <katrin.fischer.83@web.de>
Tue, 15 May 2018 23:19:53 +0000 (01:19 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 8 Jun 2018 12:17:25 +0000 (12:17 +0000)
After review of the code it turns out that the management permission
that has been marked as deprecated a long time ago, does not have
any function.

The patch removes all remaining code related to it.

To test:
- Make sure you have a patron with the management permission
- Apply patch
- Run database update
- Check everything still works as expected

Bonus:
borrowers.flags is recalculated for patrons with management
permission.

To check:
- Create some 'permission twins' with and without management
  permission
- Note the value in borrowers.flags
- Apply patch, don't run database update
- Save permissions from GUI for one of the twins
- Note the newly calculated value
- Run database update
- Now both twins should have the same borrowers.flags value

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
C4/Auth.pm
C4/InstallAuth.pm
installer/data/mysql/userflags.sql
koha-tmpl/intranet-tmpl/prog/en/includes/header.inc
koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tt
t/db_dependent/Auth.t
t/db_dependent/Search/History.t

index 10929d8..04584a9 100644 (file)
@@ -290,7 +290,7 @@ sub get_template_and_user {
         my $all_perms = get_all_subpermissions();
 
         my @flagroots = qw(circulate catalogue parameters borrowers permissions reserveforothers borrow
-          editcatalogue updatecharges management tools editauthorities serials reports acquisition clubs);
+          editcatalogue updatecharges tools editauthorities serials reports acquisition clubs);
 
         # We are going to use the $flags returned by checkauth
         # to create the template's parameters that will indicate
@@ -305,7 +305,6 @@ sub get_template_and_user {
             $template->param( CAN_user_editcatalogue    => 1 );
             $template->param( CAN_user_updatecharges    => 1 );
             $template->param( CAN_user_acquisition      => 1 );
-            $template->param( CAN_user_management       => 1 );
             $template->param( CAN_user_tools            => 1 );
             $template->param( CAN_user_editauthorities  => 1 );
             $template->param( CAN_user_serials          => 1 );
@@ -341,9 +340,6 @@ sub get_template_and_user {
             foreach my $module ( keys %$flags ) {
                 if ( $flags->{$module} == 1 or ref( $flags->{$module} ) ) {
                     $template->param( "CAN_user_$module" => 1 );
-                    if ( $module eq "parameters" ) {
-                        $template->param( CAN_user_management => 1 );
-                    }
                 }
             }
         }
index 9d285bd..500d740 100644 (file)
@@ -143,7 +143,6 @@ sub get_template_and_user {
             $template->param( CAN_user_editcatalogue    => 1 );
             $template->param( CAN_user_updatecharges    => 1 );
             $template->param( CAN_user_acquisition      => 1 );
-            $template->param( CAN_user_management       => 1 );
             $template->param( CAN_user_tools            => 1 );
             $template->param( CAN_user_editauthorities  => 1 );
             $template->param( CAN_user_serials          => 1 );
index 3e8f5dc..ae36478 100644 (file)
@@ -9,7 +9,6 @@ INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES
 (9,'editcatalogue','Edit catalog (Modify bibliographic/holdings data)',0),
 (10,'updatecharges','Manage patrons fines and fees',0),
 (11,'acquisition','Acquisition and/or suggestion management',0),
-(12,'management','Set library management parameters (deprecated)',0),
 (13,'tools','Use all tools (expand for granular tools permissions)',0),
 (14,'editauthorities','Edit authorities',0),
 (15,'serials','Manage serial subscriptions',0),
index 365abbc..3c112ee 100644 (file)
 
                     <li role="separator" class="loggedin-menu-label divider"></li>
                     [% IF ( IndependentBranches ) %]
-                        [% IF ( CAN_user_management || CAN_user_editcatalogue_edit_catalogue ) %]
+                        [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
                     <li>
                         <a class="toplinks" href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a>
                     </li>
index f29f6c2..129d7f5 100644 (file)
@@ -10,7 +10,6 @@
     [%- CASE 'editcatalogue' -%]<span>Edit catalog (Modify bibliographic/holdings data)</span>
     [%- CASE 'updatecharges' -%]<span>Manage patrons fines and fees</span>
     [%- CASE 'acquisition' -%]<span>Acquisition and/or suggestion management</span>
-    [%- CASE 'management' -%]<span>Set library management parameters (deprecated)</span>
     [%- CASE 'tools' -%]<span>Use all tools (expand for granular tools permissions)</span>
     [%- CASE 'editauthorities' -%]<span>Edit authorities</span>
     [%- CASE 'serials' -%]<span>Manage serial subscriptions</span>
index 1237f30..41c8127 100644 (file)
        <li>Acquisition and/or suggestion management</li>
        <li>This section can be expanded</li>
 </ul>
-</li>
-       <li>management
-<ul>
-       <li>Set library management parameters (deprecated)
-<ul>
-       <li style="color: #990000;">Important: This permission level no longer controls anything.</li>
-</ul>
-</li>
-</ul>
 </li>
        <li>tools
 <ul>
index c8fb1f1..8f980ee 100644 (file)
@@ -153,7 +153,7 @@ my $hash2 = hash_password('password');
             borrowers         => 0,
             catalogue         => 1, circulate         => 0,
             coursereserves    => 0, editauthorities   => 0,
-            editcatalogue     => 0, management        => 0,
+            editcatalogue     => 0,
             parameters        => 0, permissions       => 0,
             plugins           => 0, reports           => 0,
             reserveforothers  => 0, serials           => 0,
index ee01734..0e74e2d 100644 (file)
@@ -409,7 +409,7 @@ sub MockedCheckauth {
         borrowers         => 0,
         catalogue         => 1, circulate         => 0,
         coursereserves    => 0, editauthorities   => 0,
-        editcatalogue     => 0, management        => 0,
+        editcatalogue     => 0,
         parameters        => 0, permissions       => 0,
         plugins           => 0, reports           => 0,
         reserveforothers  => 0, serials           => 0,