From 93c7f2a98723bbb960a7012186ec7b30854a1fe0 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 18 May 2012 10:46:01 -0400 Subject: [PATCH] Bug 8161 - Cataloging home page should be accessible to users with permission to edit catalog or edit items This patch modifies the permissions required to access the cataloging home page (addbooks.pl) so that the user requires edit_catalogue, edit_items, or fast_cataloging permission. Users with only edit_catalogue permission will only see biblio edit links. Users with edit_items permission will only see item edit links. Users with fast_cataloging permission will only be able to view information about contents of the catalog--useless for them but I'm not sure how better to handle it. To test, log in as a user with each of the above permissions enabled separately and in combination and test access. Signed-off-by: Jared Camins-Esakov Signed-off-by: Paul Poulain --- cataloguing/addbooks.pl | 2 +- .../prog/en/modules/cataloguing/addbooks.tt | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl index b768a29e87..79534a4470 100755 --- a/cataloguing/addbooks.pl +++ b/cataloguing/addbooks.pl @@ -49,7 +49,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { editcatalogue => 'edit_catalogue' }, + flagsrequired => { editcatalogue => '*' }, debug => 1, } ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt index 03c31ed507..85ee254f44 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt @@ -19,7 +19,7 @@
-[% INCLUDE 'cataloging-toolbar.inc' %] +[% IF ( CAN_user_editcatalogue_edit_catalogue ) %][% INCLUDE 'cataloging-toolbar.inc' %][% END %] [% IF ( noitemsfound ) %] No results found @@ -125,7 +125,7 @@ Edition Coming from Preview -   + [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] [% END %] [% FOREACH breeding_loo IN breeding_loop %] [% IF ( loop.odd ) %] @@ -141,10 +141,9 @@ [% breeding_loo.file %] MARC | Card - - [% UNLESS ( CAN_user_editcatalogue_edit_catalogue ) %]Add biblio - [% ELSE %]Add biblio[% END %] - + [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] + Add biblio + [% END %] [% END %] -- 2.39.5