[Koha-bugs] [Bug 29523] Add a way to prevent embedding objects that should not be allowed
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Oct 12 12:57:42 CEST 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29523
--- Comment #118 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
(In reply to Jonathan Druart from comment #106)
> > I have written a quick follow-up on top of bug_33568 (that is based on top
> > of this one):
> > https://gitlab.com/joubu/Koha/-/commit/
> > 75b8cd39135966d2ea1b8a48df9aec4a3254d0d5
> >
> > Would that work?
>
> One thing that is not really nice is that, in Koha::Patron::to_api we are
> now having a json_patron and so not early returning, and we get 'restricted'
> in the response whereas the unredacted version should not contain it. But
> that would mean another call to is_accessible.
I've rebased the patchset and used your follow-up for inspiration but written
my own version. Instead of returning an empty hash I've bound the redaction
inside our TO_JSON method and replace the column values with redaction
replacements..
I'm not sure if this is better or worse. Also.. as you've highlighted we'll
need to deal with overloaded to_api methods somehow as they often add in data
after an inititial to_api call and we can also switch remove the code that
looks for undefined again if we go with either of these redaction techniques
instead.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list