[Koha-bugs] [Bug 28948] Add a /public counterpart for the libraries REST endpoints

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Sep 14 16:47:29 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28948

--- Comment #17 from Marcel de Rooy <m.de.rooy at 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.


More information about the Koha-bugs mailing list