Bugzilla – Attachment 75348 Details for
Bug 2426
Management permissions is deprecated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2426: Remove deprecated management permission
Bug-2426-Remove-deprecated-management-permission.patch (text/plain), 7.95 KB, created by
Katrin Fischer
on 2018-05-15 23:53:49 UTC
(
hide
)
Description:
Bug 2426: Remove deprecated management permission
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-05-15 23:53:49 UTC
Size:
7.95 KB
patch
obsolete
>From 7d9439b7d40f1ceb7c82cbdcbcbd24009a769744 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >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 >--- > C4/Auth.pm | 6 +----- > .../bug2426_remove_management_permission.sql | 3 +++ > 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, 7 insertions(+), 19 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug2426_remove_management_permission.sql > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 7442b1dd78..c4dd0c4238 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -289,7 +289,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 >@@ -304,7 +304,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 ); >@@ -340,9 +339,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/installer/data/mysql/atomicupdate/bug2426_remove_management_permission.sql b/installer/data/mysql/atomicupdate/bug2426_remove_management_permission.sql >new file mode 100644 >index 0000000000..884721d433 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug2426_remove_management_permission.sql >@@ -0,0 +1,3 @@ >+DELETE FROM userflags WHERE bit = 12 AND flag = 'management'; >+UPDATE borrowers SET flags = flags - ( flags & (1<<12) ) WHERE flags & (1 << 12); >+-- Bug 2426 - Remove deprecated management permission >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 @@ > > <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> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index 017ffb918e..4de96f8613 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' -%]<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> >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 b3bf18843c..ad549b1c47 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 @@ > <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> >diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t >index c08060e93c..0f5dc654c5 100644 >--- a/t/db_dependent/Auth.t >+++ b/t/db_dependent/Auth.t >@@ -105,7 +105,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.17.0
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 2426
:
75348
|
75349
|
75476
|
75562