Using is available for registration in access

Created on 12 February 2025, about 2 months ago

Problem/Motivation

Using Host entity::is available forRegistration() is problematic for access. The twin problems is that it's expensive and it's cacheability depends on the host registration list which could be highly dynamic.

Proposed resolution

Use a 2 step approach in the route access check:
(1) Check isOpenForRegistration().
If false, deny access with cacheability from that result.

(2) If true, then check isAvailableForRegistration(). Allow/deny as appropriate.
If the host registration list cache tag is present, strip it out and instead set the access result to expire in 1 hour.

It's not exactly elegant, but maybe it's a compromise that gives pretty good results in every scenario.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

3.3

Component

Registration Core

Created by

πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jonathanshaw
  • πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK

    I don't think it's particularly important, but thought the idea might be worth sharing.

  • πŸ‡ΊπŸ‡ΈUnited States john.oltman

    Thanks @jonathanshaw. That solution sounds like something good for a custom module. The UX when running out of room is not ideal if you just remove the Register links, which access control does, because the removal is unexpected in this case. Typically the host entity page will show the event date, so there is no surprise when the link disappears when the event date is reached. But if the link disappears a week early because it was overbooked, people will be wondering what happened, why can't I register? Thus it is better to have the links still exist and let the register form explain with a message. Obviously some text could be added to the host entity page as well, but that may not be practical for sites with many hosts, or social media posts may have direct links to the register page - do not want those to get a 403 a week early. I suppose someone could setup a redirect, but again, not sure that is always practical.

Production build 0.71.5 2024