From 870913b3c3a83568c219d6e22b7110ffd217370c Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Wed, 16 May 2018 01:19:53 +0200 Subject: [PATCH] Bug 2426: Remove deprecated management permission 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 Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens --- C4/Auth.pm | 6 +----- C4/InstallAuth.pm | 1 - installer/data/mysql/userflags.sql | 1 - koha-tmpl/intranet-tmpl/prog/en/includes/header.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc | 1 - .../prog/en/modules/help/members/member-flags.tt | 9 --------- t/db_dependent/Auth.t | 2 +- t/db_dependent/Search/History.t | 2 +- 8 files changed, 4 insertions(+), 20 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 10929d887f..04584a95f0 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -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 ); - } } } } diff --git a/C4/InstallAuth.pm b/C4/InstallAuth.pm index 9d285bda1b..500d740c96 100644 --- a/C4/InstallAuth.pm +++ b/C4/InstallAuth.pm @@ -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 ); diff --git a/installer/data/mysql/userflags.sql b/installer/data/mysql/userflags.sql index 3e8f5dc244..ae3647810d 100644 --- a/installer/data/mysql/userflags.sql +++ b/installer/data/mysql/userflags.sql @@ -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), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 365abbc2a3..3c112ee70c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -101,7 +101,7 @@ [% IF ( IndependentBranches ) %] - [% IF ( CAN_user_management || CAN_user_editcatalogue_edit_catalogue ) %] + [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
  • Set library
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index f29f6c2084..129d7f5593 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -10,7 +10,6 @@ [%- CASE 'editcatalogue' -%]Edit catalog (Modify bibliographic/holdings data) [%- CASE 'updatecharges' -%]Manage patrons fines and fees [%- CASE 'acquisition' -%]Acquisition and/or suggestion management - [%- CASE 'management' -%]Set library management parameters (deprecated) [%- CASE 'tools' -%]Use all tools (expand for granular tools permissions) [%- CASE 'editauthorities' -%]Edit authorities [%- CASE 'serials' -%]Manage serial subscriptions diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tt index 1237f30979..41c8127bec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tt @@ -85,15 +85,6 @@
  • Acquisition and/or suggestion management
  • This section can be expanded
  • - -
  • management -
      -
    • Set library management parameters (deprecated) -
        -
      • Important: This permission level no longer controls anything.
      • -
      -
    • -
  • tools
      diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t index c8fb1f186b..8f980ee261 100644 --- a/t/db_dependent/Auth.t +++ b/t/db_dependent/Auth.t @@ -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, diff --git a/t/db_dependent/Search/History.t b/t/db_dependent/Search/History.t index ee0173426c..0e74e2d68a 100644 --- a/t/db_dependent/Search/History.t +++ b/t/db_dependent/Search/History.t @@ -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, -- 2.20.1