Lines 1798-1810
sub can_see_things_from {
Link Here
|
1798 |
$can = 1; |
1798 |
$can = 1; |
1799 |
} elsif ( $self->has_permission( { $permission => $subpermission } ) ) { |
1799 |
} elsif ( $self->has_permission( { $permission => $subpermission } ) ) { |
1800 |
$can = 1; |
1800 |
$can = 1; |
1801 |
} elsif ( my $library_groups = $self->library->library_groups ) { |
1801 |
} elsif ( my @branches = $self->libraries_where_can_see_patrons ) { |
1802 |
while ( my $library_group = $library_groups->next ) { |
1802 |
$can = any { $_ eq $branchcode } @branches; |
1803 |
if ( $library_group->parent->has_child( $branchcode ) ) { |
|
|
1804 |
$can = 1; |
1805 |
last; |
1806 |
} |
1807 |
} |
1808 |
} |
1803 |
} |
1809 |
return $can; |
1804 |
return $can; |
1810 |
} |
1805 |
} |
Lines 1855-1860
sub libraries_where_can_see_things {
Link Here
|
1855 |
my $subpermission = $params->{subpermission}; |
1850 |
my $subpermission = $params->{subpermission}; |
1856 |
my $group_feature = $params->{group_feature}; |
1851 |
my $group_feature = $params->{group_feature}; |
1857 |
|
1852 |
|
|
|
1853 |
return $self->{_restricted_branchcodes} if exists($self->{_restricted_branchcodes}); |
1854 |
|
1858 |
my $userenv = C4::Context->userenv; |
1855 |
my $userenv = C4::Context->userenv; |
1859 |
|
1856 |
|
1860 |
return () unless $userenv; # For tests, but userenv should be defined in tests... |
1857 |
return () unless $userenv; # For tests, but userenv should be defined in tests... |
Lines 1881-1894
sub libraries_where_can_see_things {
Link Here
|
1881 |
} |
1878 |
} |
1882 |
} |
1879 |
} |
1883 |
|
1880 |
|
1884 |
@restricted_branchcodes = ( $self->branchcode ) unless @restricted_branchcodes; |
1881 |
@restricted_branchcodes = ( $self->branchcode ) unless @restricted_branchcodes; |
1885 |
} |
1882 |
} |
1886 |
} |
1883 |
} |
1887 |
|
1884 |
|
1888 |
@restricted_branchcodes = grep { defined $_ } @restricted_branchcodes; |
1885 |
@restricted_branchcodes = grep { defined $_ } @restricted_branchcodes; |
1889 |
@restricted_branchcodes = uniq(@restricted_branchcodes); |
1886 |
@restricted_branchcodes = uniq(@restricted_branchcodes); |
1890 |
@restricted_branchcodes = sort(@restricted_branchcodes); |
1887 |
@restricted_branchcodes = sort(@restricted_branchcodes); |
1891 |
return @restricted_branchcodes; |
1888 |
|
|
|
1889 |
$self->{_restricted_branchcodes} = \@restricted_branchcodes; |
1890 |
return @{$self->{_restricted_branchcodes}}; |
1892 |
} |
1891 |
} |
1893 |
|
1892 |
|
1894 |
=head3 has_permission |
1893 |
=head3 has_permission |
1895 |
- |
|
|