[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
Tue Oct 24 13:52:18 CEST 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29523
--- Comment #165 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Just hacking Koha::Library a bit to test things:
API crashes with 500:
[2023/10/24 11:46:55] [WARN] OpenAPI >>> GET api/v1/public/libraries
[{"message":"Expected string - got
null.","path":"\/body\/0\/name"},{"message":"Expected string - got
null.","path":"\/body\/1\/name"},{"message":"Expected string - got
null.","path":"\/body\/10\/name"},{"message":"Expected string - got
null.","path":"\/body\/11\/name"},{"message":"Expected string - got
null.","path":"\/body\/12\/name"},{"message":"Expected string - got
null.","path":"\/body\/2\/name"},{"message":"Expected string - got
null.","path":"\/body\/3\/name"},{"message":"Expected string - got
null.","path":"\/body\/4\/name"},{"message":"Expected string - got
null.","path":"\/body\/5\/name"},{"message":"Expected string - got
null.","path":"\/body\/6\/name"},{"message":"Expected string - got
null.","path":"\/body\/7\/name"},{"message":"Expected string - got
null.","path":"\/body\/8\/name"},{"message":"Expected string - got
null.","path":"\/body\/9\/name"}]
What did I do?
1) public_read_list (Remove country)
- 'branchcity', 'branchstate', 'branchcountry',
+ 'branchcity', 'branchstate',
2) Add a not accessible condition:
+sub is_accessible { return 0; }
3) Add two fields on unredact_list
+sub unredact_list { return [ 'branchcode', 'branchcountry' ]; }
Please explain to me why the API crashes?
I would expect a record where I can see the two unredacted fields on anonymous
acces via public.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list