Bug 6824 - correctly check basket viewing permissions
authorRobin Sheat <robin@catalyst.net.nz>
Wed, 31 Aug 2011 03:22:38 +0000 (15:22 +1200)
committerChris Cormack <chrisc@catalyst.net.nz>
Thu, 22 Sep 2011 23:47:25 +0000 (11:47 +1200)
Previously you couldn't view baskets that you hadn't created, unless you
were superlibrarian due to a bug. Now people with the right permissions
can see the baskets.

Applies to both 3.04.04 and master.

Signed-off-by: Brendan <info@bywatersolutions.com>
Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
acqui/basket.pl
acqui/booksellers.pl

index dfc9447..70fb39c 100755 (executable)
@@ -197,7 +197,7 @@ if ( $op eq 'delete_confirm' ) {
 #if the basket is closed,and the user has the permission to edit basketgroups, display a list of basketgroups
     my $basketgroups;
     my $member = GetMember(borrowernumber => $loggedinuser);
-    if ($basket->{closedate} && haspermission({ flagsrequired   => { acquisition => 'group_manage'} })) {
+    if ($basket->{closedate} && haspermission({ acquisition => 'group_manage'} )) {
         $basketgroups = GetBasketgroups($basket->{booksellerid});
         for my $bg ( @{$basketgroups} ) {
             if ($basket->{basketgroupid} && $basket->{basketgroupid} == $bg->{id}){
index cc5c084..fb6b2f1 100755 (executable)
@@ -106,7 +106,7 @@ for my $vendor (@suppliers) {
         if ((      $basket->{authorisedby}
                 && $basket->{authorisedby} eq $loggedinuser
             )
-            || haspermission( $uid, { flagsrequired => { acquisition => q{*} } } )
+            || haspermission( $uid, { acquisition => q{*} } )
           ) {
             for my $date_field (qw( creationdate closedate)) {
                 if ( $basket->{$date_field} ) {