Page MenuHomePhabricator

Centralise/deduplicate authentication code for invitation special pages.
Closed, ResolvedPublic3 Estimated Story Points

Description

All event invitations special pages perform the same checks (to see if the feature is enabled and if the user is allowed to use the feature), we should consolidate these checks in one place.

Event Timeline

Thanks for writing this ticket, @MHorsey-WMF! Perhaps it can be estimated and discussed by the team in the Monday meeting next week. How does that sound?

Change #1053897 had a related patch set uploaded (by Mhorsey; author: Mhorsey):

[mediawiki/extensions/CampaignEvents@master] Migrate access check to trait, to remove code duplication

https://gerrit.wikimedia.org/r/1053897

Change #1053897 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Migrate access check to trait, to remove code duplication

https://gerrit.wikimedia.org/r/1053897

Daimona subscribed.

For QA, the only thing to check is that the behaviour of all the invitation list special pages (Special:GenerateInvitationList, Special:InvitationList, Special:MyInvitationLists) is unchanged in the following scenarios:

  • Invitation lists not enabled ($wgCampaignEventsEnableEventInvitation = false)
  • Invitation lists enabled, but user not allowed to use them
  • Invitation lists enabled, and user is allowed to use them
vaughnwalters subscribed.

For QA, the only thing to check is that the behaviour of all the invitation list special pages (Special:GenerateInvitationList, Special:InvitationList, Special:MyInvitationLists) is unchanged in the following scenarios:

✅ Invitation lists not enabled ($wgCampaignEventsEnableEventInvitation = false)

Screenshot 2024-07-23 at 11.06.56 AM.png (370×1 px, 66 KB)

✅ Invitation lists enabled, but user not allowed to use them
Screenshot 2024-07-23 at 11.06.43 AM.png (166×716 px, 16 KB)

✅ Invitation lists enabled, and user is allowed to use them

Special:MyInvitationListsSpecial:GenerateInvitationListSpecial:InvitationList,
Screenshot 2024-07-23 at 12.57.08 PM.png (866×810 px, 56 KB)
Screenshot 2024-07-23 at 12.58.06 PM.png (1×1 px, 96 KB)
Screenshot 2024-07-23 at 12.58.24 PM.png (1×2 px, 175 KB)

This is working as expected, sending to product sign off.