Bugzilla – Attachment 84358 Details for
Bug 22198
Add granular permission setting for Mana KB
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22198: Add granular permission setting for Mana KB
Bug-22198-Add-granular-permission-setting-for-Mana.patch (text/plain), 8.21 KB, created by
Owen Leonard
on 2019-01-24 15:47:46 UTC
(
hide
)
Description:
Bug 22198: Add granular permission setting for Mana KB
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2019-01-24 15:47:46 UTC
Size:
8.21 KB
patch
obsolete
>From e2bf25dd1b36fb5c543dfd33d70d8de4aa4b9a4f Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 24 Jan 2019 13:47:26 +0000 >Subject: [PATCH] Bug 22198: Add granular permission setting for Mana KB > >This patch adds a separate permission for managing Mana KB. > >To test, apply the patch and update the database. > > - Open the permissions page for a patron with staff client privileges > - Confirm that there is a "Manage Mana KB content sharing > (manage_mana)" permission. > - Leaving this new permission unchecked, log into the staff client > with as that patron and go to the Administration home page. > - The "Using Mana-KB" link should not appear. > - Navigate directly to /cgi-bin/koha/admin/share_content.pl. You > should get a "permission denied" message. > - Modify the patron's permissions to grant them access to Mana KB. > - Confirm that the link now appears on the Administration home > page and that the user can access the page. >--- > admin/share_content.pl | 2 +- > .../bug_22198-mana_manage_permission.sql | 1 + > installer/data/mysql/userpermissions.sql | 1 + > .../intranet-tmpl/prog/en/includes/permissions.inc | 1 + > .../prog/en/modules/admin/admin-home.tt | 34 ++++++++++++---------- > 5 files changed, 22 insertions(+), 17 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_22198-mana_manage_permission.sql > >diff --git a/admin/share_content.pl b/admin/share_content.pl >index d900b3e..475771a 100755 >--- a/admin/share_content.pl >+++ b/admin/share_content.pl >@@ -33,7 +33,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > query => $query, > type => "intranet", > authnotrequired => 0, >- flagsrequired => { parameters => '*' }, >+ flagsrequired => { parameters => 'manage_mana' }, > debug => 1, > } > ); >diff --git a/installer/data/mysql/atomicupdate/bug_22198-mana_manage_permission.sql b/installer/data/mysql/atomicupdate/bug_22198-mana_manage_permission.sql >new file mode 100644 >index 0000000..b8d15bc >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_22198-mana_manage_permission.sql >@@ -0,0 +1 @@ >+INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ( 3, 'manage_mana', 'Manage Mana KB content sharing'); >diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql >index ba1061e..16b003e 100644 >--- a/installer/data/mysql/userpermissions.sql >+++ b/installer/data/mysql/userpermissions.sql >@@ -30,6 +30,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 3, 'manage_sms_providers', 'Manage SMS cellular providers'), > ( 3, 'manage_audio_alerts', 'Manage audio alerts'), > ( 3, 'manage_usage_stats', 'Manage usage statistics settings'), >+ ( 3, 'manage_mana', 'Manage Mana KB content sharing'), > ( 4, 'edit_borrowers', 'Add, modify and view patron information'), > ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'), > ( 6, 'place_holds', 'Place holds for patrons'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index ff2d8ee..fab6136 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -59,6 +59,7 @@ > [%- CASE 'manage_audio_alerts' -%]<span>Manage audio alerts</span> > [%- CASE 'manage_sms_providers' -%]<span>Manage SMS cellular providers</span> > [%- CASE 'manage_usage_stats' -%]<span>Manage usage statistics settings</span> >+ [%- CASE 'manage_mana' -%]<span>Manage Mana KB content sharing</span> > [%- CASE 'edit_borrowers' -%]<span>Add, modify and view patron information</span> > [%- CASE 'view_borrower_infos_from_any_libraries' -%]<span>View patron infos from any libraries. If not set the logged in user could only access patron infos from its own library or group of libraries.</span> > [%- CASE 'modify_holds_priority' -%]<span>Modify holds priority</span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >index 038408e..b23d60f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >@@ -13,20 +13,22 @@ > <div class="main container-fluid"> > <div class="row"> > <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2"> >- [% IF ( Koha.Preference('Mana') == 1) && !mana_url %] >- <div class="dialog message"> >- <h4>The Mana Knowledge Base feature is enabled but not configured.</h4> >- <p>This feature allows you to retrieve and share data (subscription patterns and reports) with other Koha libaries.</p> >- <p> >- Ask your system administrator to configure this feature, or remove this note by <a href=/cgi-bin/koha/admin/share_content.pl>disabling the 'Mana' system preference</a>. >- </p> >- </div> >- [% END %] >- [% IF ( Koha.Preference('Mana') == 2 ) %] >- <div class="dialog message"> >- <h4>Share content with Mana KB?</h4> >- <p> You haven't decided if you want to activate Mana Knowledge Base. <a href=/cgi-bin/koha/admin/share_content.pl>Change your Mana KB settings</a>.</p> >- </div> >+ [% IF ( CAN_user_parameters_manage_mana ) %] >+ [% IF ( Koha.Preference('Mana') == 1) && !mana_url %] >+ <div class="dialog message"> >+ <h4>The Mana Knowledge Base feature is enabled but not configured.</h4> >+ <p>This feature allows you to retrieve and share data (subscription patterns and reports) with other Koha libaries.</p> >+ <p> >+ Ask your system administrator to configure this feature, or remove this note by <a href=/cgi-bin/koha/admin/share_content.pl>disabling the 'Mana' system preference</a>. >+ </p> >+ </div> >+ [% END %] >+ [% IF ( Koha.Preference('Mana') == 2 ) %] >+ <div class="dialog message"> >+ <h4>Share content with Mana KB?</h4> >+ <p> You haven't decided if you want to activate Mana Knowledge Base. <a href=/cgi-bin/koha/admin/share_content.pl>Change your Mana KB settings</a>.</p> >+ </div> >+ [% END %] > [% END %] > <h1>Koha administration</h1> > <div class="row"> >@@ -172,7 +174,7 @@ > </dl> > [% END %] > >- [% IF ( ( CAN_user_parameters_manage_search_targets || CAN_user_parameters_manage_didyoumean || CAN_user_parameters_manage_column_config || CAN_user_parameters_manage_audio_alerts || CAN_user_parameters_manage_sms_providers && Koha.Preference('SMSSendDriver') == 'Email' ) || CAN_user_parameters_manage_usage_stats ) %] >+ [% IF ( ( CAN_user_parameters_manage_search_targets || CAN_user_parameters_manage_didyoumean || CAN_user_parameters_manage_column_config || CAN_user_parameters_manage_audio_alerts || CAN_user_parameters_manage_sms_providers && Koha.Preference('SMSSendDriver') == 'Email' ) || CAN_user_parameters_manage_usage_stats || CAN_user_parameters_manage_mana ) %] > <h3>Additional parameters</h3> > <dl> > <!-- <dt><a href="/cgi-bin/koha/admin/printers.pl">Network Printers</a></dt> >@@ -201,7 +203,7 @@ > <dt><a href="/cgi-bin/koha/admin/usage_statistics.pl">Share your usage statistics</a></dt> > <dd>Share with the Koha community the usage statistics of your Koha installation.</dd> > [% END %] >- [% IF ( CAN_user_parameters ) %] >+ [% IF ( CAN_user_parameters_manage_mana ) %] > <dt><a href="/cgi-bin/koha/admin/share_content.pl">Share content with Mana KB</a></dt> > <dd>Share content (subscriptions, reports) with Koha communty</dd> > [% END %] >-- >2.1.4
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 22198
:
84356
|
84358
|
84431
|
84453