Bug 8161 - Cataloging home page should be accessible to users with permission to...
authorOwen Leonard <oleonard@myacpl.org>
Fri, 18 May 2012 14:46:01 +0000 (10:46 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 5 Jun 2012 14:52:10 +0000 (16:52 +0200)
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 <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
cataloguing/addbooks.pl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt

index b768a29..79534a4 100755 (executable)
@@ -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,
     }
 );
index 03c31ed..85ee254 100644 (file)
@@ -19,7 +19,7 @@
    <div id="bd">
        <div id="yui-main">
 
-[% INCLUDE 'cataloging-toolbar.inc' %]
+[% IF ( CAN_user_editcatalogue_edit_catalogue ) %][% INCLUDE 'cataloging-toolbar.inc' %][% END %]
 
        [% IF ( noitemsfound ) %]
                No results found
                 <th>Edition</th>
                 <th>Coming from</th>
                 <th>Preview</th>
-                <th>&nbsp;</th>
+                [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<th>&nbsp;</th>[% END %]
             </tr>
             [% FOREACH breeding_loo IN breeding_loop %]
             [% IF ( loop.odd ) %]
                 <td>[% breeding_loo.file %]</td>
                 <td> <a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.id %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.id %]" title="MARC" rel="gb_page_center[600,500]">Card</a>
                                </td>
-                <td>
-                    [% UNLESS ( CAN_user_editcatalogue_edit_catalogue ) %]<a href="/cgi-bin/koha/cataloguing/addbiblio.pl?breedingid=[% breeding_loo.id %]" class="disabled" onclick="return false;">Add biblio</a>
-                    [% ELSE %]<a href="/cgi-bin/koha/cataloguing/addbiblio.pl?breedingid=[% breeding_loo.id %]">Add biblio</a>[% END %]
-                </td>
+                [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<td>
+                    <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?breedingid=[% breeding_loo.id %]">Add biblio</a>
+                </td>[% END %]
             </tr>
             [% END %]
         </table>