- Issue created by @jonathanshaw
- π¬π§United Kingdom jonathanshaw Stroud, UK
Here is a rough demonstration of how this might work.
- Status changed to Needs work
5 months ago 8:50pm 2 August 2024 - π¬π§United Kingdom jonathanshaw Stroud, UK
This has a fair number of test failures. Before spending time debugging them it would help to:
1. Have input on john.oltman on how this seems in general
2. Get π Fix access cacheability Needs review committed - Status changed to Needs review
5 months ago 4:38pm 3 August 2024 - πΊπΈUnited States john.oltman
Cacheability has been committed. Will give input on the approach later this week.
- πΊπΈUnited States john.oltman
Sorry for the delay, this is back on my radar for another look in the near future.
- πΊπΈUnited States john.oltman
I like the direction this is going. Let's decide if we're going to create a new service named "RegistrationAccessChecker" as mentioned in https://www.drupal.org/project/registration/issues/3464137 β¨ Make it possible to customise who can administer registrations Active . If we are, then instead of calling host_entity->access with administer related permission names in a few places, you'd call the new service; the host entity operations to keep in that case would be (renaming to singular to be operation minded and not permission sounding):
view_registration
update_registration
delete_registration
manage_settings
register_self
register_authenticated
register_anonymousAs far as retaining the ability for developers to customize "administer" rights (since there would not be administer operations) - if we do the new service, that service can implement an alter hook e.g. hook_registration_access_check.
- πΊπΈUnited States john.oltman
I updated the previous comment to fix the operation names. We do want plural here as a host has N registrations.
- π¬π§United Kingdom jonathanshaw Stroud, UK
This will need updating if β¨ Make it possible to customise who can administer registrations Active is committed first, or vice versa.
- π¬π§United Kingdom jonathanshaw Stroud, UK
I've addressed the impact of [##3464137], but we need test coverage for hook_registration_host_access().
- π¬π§United Kingdom jonathanshaw Stroud, UK
Finally I think this is ready.
- π¬π§United Kingdom jonathanshaw Stroud, UK
Unfortunately extending EntityAccessControlHandler is a breach of the interface:
37 Parameter #1 $host_entity (Drupal\registration\HostEntityInterface) of method Drupal\registration\RegistrationHostAccessControlHandler::access() is not contravariant with parameter #1 $entity (Drupal\Core\Entity\EntityInterface) of method Drupal\Core\Entity\EntityAccessControlHandler::access(). 105 Parameter #1 $host_entity (Drupal\registration\HostEntityInterface) of method Drupal\registration\RegistrationHostAccessControlHandler::checkAccess() is not contravariant with parameter #1 $entity (Drupal\Core\Entity\EntityInterface) of method Drupal\Core\Entity\EntityAccessControlHandler::checkAccess().
-
john.oltman β
committed 75f01b7c on 3.3.x authored by
jonathanshaw β
git commit -m '#3464498 by jonathanshaw: Add a host access handler'
-
john.oltman β
committed 75f01b7c on 3.3.x authored by
jonathanshaw β
-
john.oltman β
committed 30c2880d on 3.1.x authored by
jonathanshaw β
#3464498 by jonathanshaw: Add a host access handler
-
john.oltman β
committed 30c2880d on 3.1.x authored by
jonathanshaw β
- πΊπΈUnited States john.oltman
Merged, great stuff Jonathan
Fumbled the commit message on 3.3.x but otherwise it's in and there is no going back. Got it right on 3.1.x.
3.1.x is failing tests due to a composer issue - may be something upstream - will look into later
Automatically closed - issue fixed for 2 weeks with no activity.