|
Lines 72-80
BEGIN {
Link Here
|
| 72 |
@ISA = qw(Exporter); |
72 |
@ISA = qw(Exporter); |
| 73 |
|
73 |
|
| 74 |
@EXPORT_OK = qw( |
74 |
@EXPORT_OK = qw( |
| 75 |
checkauth check_api_auth get_session check_cookie_auth checkpw checkpw_internal checkpw_hash |
75 |
checkauth check_api_auth get_session check_cookie_auth checkpw checkpw_internal checkpw_hash |
| 76 |
get_all_subpermissions get_user_subpermissions track_login_daily in_iprange |
76 |
get_all_subpermissions get_cataloguing_page_permissions get_user_subpermissions track_login_daily in_iprange |
| 77 |
get_template_and_user haspermission create_basic_session |
77 |
get_template_and_user haspermission create_basic_session |
| 78 |
); |
78 |
); |
| 79 |
|
79 |
|
| 80 |
$ldap = C4::Context->config('useldapserver') || 0; |
80 |
$ldap = C4::Context->config('useldapserver') || 0; |
|
Lines 471-477
sub get_template_and_user {
Link Here
|
| 471 |
minPasswordLength => $minPasswordLength, |
471 |
minPasswordLength => $minPasswordLength, |
| 472 |
); |
472 |
); |
| 473 |
if ( $in->{'type'} eq "intranet" ) { |
473 |
if ( $in->{'type'} eq "intranet" ) { |
|
|
474 |
|
| 474 |
$template->param( |
475 |
$template->param( |
|
|
476 |
can_see_cataloguing_module => haspermission( $user, get_cataloguing_page_permissions() ) ? 1 : 0, |
| 475 |
AmazonCoverImages => C4::Context->preference("AmazonCoverImages"), |
477 |
AmazonCoverImages => C4::Context->preference("AmazonCoverImages"), |
| 476 |
AutoLocation => C4::Context->preference("AutoLocation"), |
478 |
AutoLocation => C4::Context->preference("AutoLocation"), |
| 477 |
PatronAutoComplete => C4::Context->preference("PatronAutoComplete"), |
479 |
PatronAutoComplete => C4::Context->preference("PatronAutoComplete"), |
|
Lines 2185-2190
sub get_all_subpermissions {
Link Here
|
| 2185 |
return $all_perms; |
2187 |
return $all_perms; |
| 2186 |
} |
2188 |
} |
| 2187 |
|
2189 |
|
|
|
2190 |
=head2 get_cataloguing_page_permissions |
| 2191 |
|
| 2192 |
my $required_permissions = get_cataloguing_page_permissions(); |
| 2193 |
|
| 2194 |
Returns the required permissions to access the main cataloguing page. Useful for building |
| 2195 |
the global I<can_see_cataloguing_module> template variable, and also for reusing in |
| 2196 |
I<cataloging-home.pl>. |
| 2197 |
|
| 2198 |
=cut |
| 2199 |
|
| 2200 |
sub get_cataloguing_page_permissions { |
| 2201 |
|
| 2202 |
my @cataloguing_tools_subperms = qw( |
| 2203 |
inventory |
| 2204 |
items_batchdel |
| 2205 |
items_batchmod |
| 2206 |
items_batchmod |
| 2207 |
label_creator |
| 2208 |
manage_staged_marc |
| 2209 |
marc_modification_templates |
| 2210 |
records_batchdel |
| 2211 |
records_batchmod |
| 2212 |
stage_marc_import |
| 2213 |
upload_cover_images |
| 2214 |
); |
| 2215 |
|
| 2216 |
return [ |
| 2217 |
{ editcatalogue => '*' }, { tools => \@cataloguing_tools_subperms }, |
| 2218 |
C4::Context->preference('StockRotation') ? { stockrotation => 'manage_rotas' } : () |
| 2219 |
]; |
| 2220 |
} |
| 2221 |
|
| 2188 |
=head2 haspermission |
2222 |
=head2 haspermission |
| 2189 |
|
2223 |
|
| 2190 |
$flagsrequired = '*'; # Any permission at all |
2224 |
$flagsrequired = '*'; # Any permission at all |