Lines 23-28
use warnings;
Link Here
|
23 |
use Carp; |
23 |
use Carp; |
24 |
use C4::Context; |
24 |
use C4::Context; |
25 |
use C4::Debug; |
25 |
use C4::Debug; |
|
|
26 |
use C4::Members; |
26 |
|
27 |
|
27 |
use constant SHELVES_MASTHEAD_MAX => 10; #number under Lists button in masthead |
28 |
use constant SHELVES_MASTHEAD_MAX => 10; #number under Lists button in masthead |
28 |
use constant SHELVES_COMBO_MAX => 10; #add to combo in search |
29 |
use constant SHELVES_COMBO_MAX => 10; #add to combo in search |
Lines 431-437
ShelfPossibleAction($loggedinuser, $shelfnumber, $action);
Link Here
|
431 |
|
432 |
|
432 |
C<$loggedinuser,$shelfnumber,$action> |
433 |
C<$loggedinuser,$shelfnumber,$action> |
433 |
|
434 |
|
434 |
$action can be "view", "add", "delete", "manage", "new_public", "new_private". |
435 |
$action can be "view", "add", "delete", "manage", "new_public", "new_private" or "merge". |
435 |
Note that add/delete here refers to adding/deleting entries from the list. Deleting the list itself falls under manage. |
436 |
Note that add/delete here refers to adding/deleting entries from the list. Deleting the list itself falls under manage. |
436 |
new_public and new_private refers to creating a new public or private list. |
437 |
new_public and new_private refers to creating a new public or private list. |
437 |
The distinction between deleting your own entries from the list or entries from |
438 |
The distinction between deleting your own entries from the list or entries from |
Lines 489-495
sub ShelfPossibleAction {
Link Here
|
489 |
return 1 if $user>0 && ($shelf->{allow_delete_own}==1 || $shelf->{allow_delete_other}==1); |
490 |
return 1 if $user>0 && ($shelf->{allow_delete_own}==1 || $shelf->{allow_delete_other}==1); |
490 |
} |
491 |
} |
491 |
elsif($action eq 'manage') { |
492 |
elsif($action eq 'manage') { |
492 |
return 1 if $user && $shelf->{owner}==$user; |
493 |
my $borrower = GetMemberDetails($user); |
|
|
494 |
return 1 if ($user && $shelf->{owner}==$user) || C4::Auth::haspermission($borrower->{'userid'}, {'editcatalogue' => 'manage_shelves'}); |
495 |
} |
496 |
elsif($action eq 'merge') { |
497 |
my $borrower = GetMemberDetails($user); |
498 |
return 1 if C4::Auth::haspermission($borrower->{'userid'}, {'editcatalogue' => 'merge_from_shelves'}); |
493 |
} |
499 |
} |
494 |
return 0; |
500 |
return 0; |
495 |
} |
501 |
} |