Bug 41292: Rename whitelist to allowlist and add force_password_reset_when_set_by_staff
To test: 1 - Attempt to save a report containing "select force_password_reset_when_set_by_staff from categories" 2 - observe koha prevents this save 3 - apply patch, restart services 4 - repeat step 1 5 - observe your report now saves and runs successfully While adding this new field to the list of allowed fields, I changed "whitelist" to "allowlist" as suggested by the terminology guide: https://wiki.koha-community.org/wiki/Terminology Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
1bb2532f33
commit
fdc57489a1
|
|
@ -29,8 +29,8 @@ use base qw(Koha::Object);
|
|||
# TODO Koha::Report->store should check this before saving
|
||||
|
||||
use constant FORBIDDEN_COLUMN_MATCHES => qw(password token uuid secret);
|
||||
use constant WHITELISTED_COLUMN_NAMES =>
|
||||
qw(password_expiration_date password_expiry_days reset_password change_password min_password_length require_strong_password password_expiration_date);
|
||||
use constant ALLOWLISTED_COLUMN_NAMES =>
|
||||
qw(password_expiration_date password_expiry_days reset_password change_password min_password_length require_strong_password password_expiration_date force_password_reset_when_set_by_staff);
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -99,8 +99,8 @@ sub check_columns {
|
|||
@columns = grep { /$regex/i } @columns;
|
||||
}
|
||||
|
||||
# Check for whitelisted variants
|
||||
$regex = '(^' . ( join '|', WHITELISTED_COLUMN_NAMES ) . ')$'; # should be full match
|
||||
# Check for allowlisted variants
|
||||
$regex = '(^' . ( join '|', ALLOWLISTED_COLUMN_NAMES ) . ')$'; # should be full match
|
||||
@columns = grep { !/$regex/i } @columns;
|
||||
return @columns;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue