https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28948
--- Comment #17 from Marcel de Rooy <m.de.r...@rijksmuseum.nl> --- + # FIXME: All modules should have a corresponding allowlist eventually + my $allowclass = ref($self) . '::Allowlist'; + if ( can_load( modules => { $allowclass => undef } ) ) { + my $allowlist = $allowclass->new( + { interface => $params->{public} ? 'opac' : 'staff' } ); + $allowlist->load; + my $blocked = $allowlist->apply( { input => $json_object } ); + Koha::Logger->get->debug( + ref($self) + . "::to_api allowlist blocked fields: " + . ( + join ', ', + map { $_ . '=' . $blocked->{$_} } sort keys %$blocked + ) + ) if keys %$blocked; So this would become something like (using api_staff and api_public; whats in a name): $json_object = $self->filter({ column_set => $params->{public} ? 'api_public' : 'api' }); It is just one line if you skip logging. Which is probably fine here. If we need it, the idea is now to add a dump => $dump parameter. Note that the concept is still a concept. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/