Skip to content

fix #2126 filter commonsbooking_isCurrentUserAdmin not granting edit permissions - #36

Open
datengraben wants to merge 171 commits into
masterfrom
claude/commonsbooking-extensibility-plan-pi6u5y
Open

fix #2126 filter commonsbooking_isCurrentUserAdmin not granting edit permissions#36
datengraben wants to merge 171 commits into
masterfrom
claude/commonsbooking-extensibility-plan-pi6u5y

Conversation

@datengraben

Copy link
Copy Markdown
Owner

No description provided.

hansmorb and others added 30 commits April 1, 2026 15:13
…e-2156

GBFS: refactor every response to go through same validation function
wielebenwir#2158 BookingRule::checkMaxBookingDays does not work for uneven amount of days
…#2167)

Bumps [@wordpress/env](https://github.com/WordPress/gutenberg/tree/HEAD/packages/env) from 11.3.0 to 11.4.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/env/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/env@11.4.0/packages/env)

---
updated-dependencies:
- dependency-name: "@wordpress/env"
  dependency-version: 11.4.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [cypress](https://github.com/cypress-io/cypress) from 15.13.1 to 15.14.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md)
- [Commits](cypress-io/cypress@v15.13.1...v15.14.0)

---
updated-dependencies:
- dependency-name: cypress
  dependency-version: 15.14.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [grunt](https://github.com/gruntjs/grunt) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/gruntjs/grunt/releases)
- [Changelog](https://github.com/gruntjs/grunt/blob/main/CHANGELOG)
- [Commits](gruntjs/grunt@v1.6.1...v1.6.2)

---
updated-dependencies:
- dependency-name: grunt
  dependency-version: 1.6.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [prettier](https://github.com/prettier/prettier) from 3.8.1 to 3.8.3.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@3.8.1...3.8.3)

---
updated-dependencies:
- dependency-name: prettier
  dependency-version: 3.8.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [sass](https://github.com/sass/dart-sass) from 1.97.3 to 1.99.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](sass/dart-sass@1.97.3...1.99.0)

---
updated-dependencies:
- dependency-name: sass
  dependency-version: 1.99.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [vue](https://github.com/vuejs/core) from 3.5.30 to 3.5.33.
- [Release notes](https://github.com/vuejs/core/releases)
- [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md)
- [Commits](vuejs/core@v3.5.30...v3.5.33)

---
updated-dependencies:
- dependency-name: vue
  dependency-version: 3.5.33
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [cypress](https://github.com/cypress-io/cypress) from 15.14.0 to 15.14.1.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md)
- [Commits](cypress-io/cypress@v15.14.0...v15.14.1)

---
updated-dependencies:
- dependency-name: cypress
  dependency-version: 15.14.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…at were not a question before for consistency.

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
hansmorb and others added 30 commits July 8, 2026 10:41
* Revert "fix wielebenwir#2204: api routes could not be validated when api key was present"

This reverts commit 617cef5.

* wielebenwir#2251 support passing apikey by header

* wielebenwir#2251 make independent from existence of apache getallheaders fn
Bumps [cypress](https://github.com/cypress-io/cypress) from 15.17.0 to 15.18.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md)
- [Commits](cypress-io/cypress@v15.17.0...v15.18.0)

---
updated-dependencies:
- dependency-name: cypress
  dependency-version: 15.18.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/cache](https://github.com/actions/cache) from 5 to 6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v5...v6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
wielebenwir#2253 fix available_until incorrect when booking offset is defined
Audits the current hook/filter surface, identifies the booking lifecycle
as the critical extensibility gap, and proposes a phased catalog of
actions and filters so third parties can adapt CommonsBooking to their
specific booking use case (smart locks, vehicle sharing, custom pricing)
without forking core or overriding templates.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Introduces action hooks so extensions can react to the booking lifecycle
without overriding templates or forking core:

  * commonsbooking_booking_created        - once, when a booking first
                                            enters a real status
  * commonsbooking_booking_confirmed      - when a booking becomes confirmed
  * commonsbooking_booking_cancelled      - when a booking is cancelled
  * commonsbooking_booking_status_changed - on every status transition

created/confirmed/status_changed are dispatched from a new
Service\BookingLifecycle listening on WordPress' transition_post_status,
so they fire once per real transition regardless of origin (frontend
calendar, admin backend, REST API, WP-CLI). Cancellation writes the status
directly to the database to preserve meta, so it is owned by
Model\Booking::cancel(), which fires commonsbooking_booking_cancelled.

Each hook passes the booking ID and the Model\Booking instance
(status_changed also passes old and new status). This addresses the
long-standing request for a post-booking action hook (e.g. smart-lock
integrations).

Adds PHPUnit coverage for each hook and documents them (EN + DE).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations override the default booking cancellation policy
(e.g. enforce a notice period or allow a custom role). Passes the default
decision and the Model\Booking instance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations adjust or add meta data on the post array just before a
booking is inserted or updated. Passes the wp_insert/update_post array and
the existing Model\Booking (or null for a new booking).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations add custom booking-window rules on top of the default
advance-booking-days check. Passes the default decision and the
Model\Timeframe instance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations add, remove or adjust the bookable slots computed for a
single day (e.g. to reflect an external availability source). Passes the
slots array and the Model\Day instance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations restrict or extend which timeframes are offered for
booking. Passes the bookable timeframes and the location/item IDs the
query was scoped to.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations adjust the data array that drives the frontend booking
calendar (and its AJAX endpoint) before it is rendered or returned as JSON.
Passes the calendar data and the item and location it is for.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations add or adjust fields exposed for an item in the
CommonsAPI. Passes the prepared item object and the source WP_Post. Gives
the CommonsAPI item response the same extensibility GBFS feeds already have.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations adjust the availability slots exposed through the
CommonsAPI (e.g. to reflect an external booking source). Passes the slots
array and the requested item ID (or null for all items).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter can both forbid an otherwise-allowed cancellation and
allow one that is denied by default, and that it receives the Model\Booking
instance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter can add meta that is persisted with a newly created
booking, and that it receives null as the existing-booking argument for a
new booking.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter can override the default bookable decision and receives
the Model\Timeframe instance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter can adjust the slots computed for a day and receives the
Model\Day instance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the returned timeframe list is exactly what the filter produces and
that the filter receives the location/item scope of the query.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter's change to the calendar data is reflected in the
returned payload and that the filter receives the item and location.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter can change an item field returned by the CommonsAPI and
receives the source WP_Post. Modifies an in-schema field so response
validation still passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter can clear the availability slots returned by the
CommonsAPI and receives the requested item ID.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Registers CommonsBooking as an Uncanny Automator integration with a single
anonymous trigger, "A booking is confirmed", built on the
commonsbooking_booking_confirmed lifecycle action. This lets site owners
build no-code recipes (send an email, call a webhook, program a smart lock)
when a booking is confirmed, exposing tokens for the booking ID, item,
location, start/end, booking code, user email and booking URL.

The integration is an optional compatibility layer: it lives outside the
PSR-4 src/ tree and only loads on Automator's automator_add_integration
hook behind a class_exists guard, so it adds no overhead and no hard
dependency when Automator is not installed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Adds a second Automator trigger, "A booking is cancelled", built on the
existing commonsbooking_booking_cancelled action, so cancellations can be
routed to any messaging gateway Automator supports (Twilio SMS, Slack,
Telegram, …) — e.g. alerting the volunteer team that an item has freed up.

Shared token definition/hydration is extracted into a Booking_Tokens trait
used by both the confirmed and cancelled triggers, and a new
CB_BOOKING_USER_PHONE token is exposed so recipes can send SMS to the
booking user (read from the CommonsBooking 'phone' user meta).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants