Repository navigation
Conversation
Public (not logged-in) users could see reservation labels on the schedule when privacy.view.reservations is true, but opening a reservation failed with "no permissions to any of the resources". Both the popup and view-reservation.php check permission rows by UserId, and the public session (UserId 0) has none. Add privacy.view.public.reservation.details (default false). When it and privacy.view.reservations are both true, the popup and the reservation detail page grant a public user the resources of the reservation they opened. The shared condition lives in ReservationDetailsFilter::CanPublicViewDetails(). Existing installs are unchanged because privacy.view.reservations keeps its meaning. Builds on the approach of LibreBooking#1331 by Norbert Krings, reworked to sit behind a new setting as suggested in the review. Related: LibreBooking#444, LibreBooking#1331 Assisted-by: Claude:claude-sonnet-5-5
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With
privacy.view.schedulesandprivacy.view.reservationsset totrue, public (not logged-in) visitors see reservation labels on theschedule. Opening a reservation, either from the popup or from
view-reservation.php, fails with:Both places look up resource permissions by
UserId. A public sessionhas
UserId = 0, so the lookup is always empty. This worked up to2.8.6 and regressed in 2.8.6.2 (see #444).
Change
Add
privacy.view.public.reservation.details(boolean, defaultfalse). When it andprivacy.view.reservationsare bothtrue, thepopup (
ReservationPopupPresenter) and the detail page(
ReservationDetailsBinder) grant a public user the resources of thereservation they opened, instead of querying permission rows.
ReservationDetailsFilter::CanPublicViewDetails().LB_PRIVACY_VIEW_PUBLIC_RESERVATION_DETAILS.config.dist.phpand.env.exampleare regenerated; docs updated inADMINISTRATION.rstandBASIC-CONFIGURATION.rst.Why a new setting
Changing what
privacy.view.reservationsdoes would expose details onexisting installs without any config change, which could be a security
regression. This was raised in the review of #1331. With the new
setting defaulting to
false, upgrades behave exactly as before.Not included
SlotLabelFactory: the schedule labels are already handled ondevelop.filtered; a public user sees all resources of a reservation they can
already see on the public schedule.
Testing
ReservationDetailsFilterTest: both settings on, either setting off,and a logged-in user.
ReservationPopupPresenterTest: a public user gets the reservation'sresource IDs bound.
composer config-dist:checkandcomposer env-example:checkpass.develop(
ConfigTest::testHistoricalLegacyConfigDevelParsesCorrectly,PluginConfigLoadingTest::testPluginConfigValidation).Not yet verified manually in a running instance: set both settings to
true, open a reservation from the public schedule in a privatewindow, and open
view-reservation.php?rn=<reference number>.Credit
Builds on the approach of #1331 by Norbert Krings, reworked to sit
behind a new setting as suggested in the review.
Related: #444, #1331
🤖 Generated with Claude Code