Page MenuHomePhabricator

Make all event-dependent organizer permission checks fail if the event is not local
Closed, ResolvedPublic

Description

For T323228, we are making it so that all organizer actions (like being able to edit the event, remove participants, send messages, etc.) will have to be made on the wiki where the event was created. While the other subtasks of T323228 cover the UI aspect of this (and also some specific REST API responses), the backend for permission checks should always fail when the event is nonlocal, as a last line of defense.

Acceptance criteria

  • The internal PermissionChecker methods should disallow the action (= return false) for all the following actions when the event is not local:
    • Edit event
    • Delete event
    • Register for event
    • Message participants
    • Remove participants
    • View private participants
    • View participants' non-PII answers
    • View aggregated answers

Note: in theory, it should not be possible to test these changes. As mentioned above, these are just the last line of defense, and the event wiki check should normally be done separately in the interface.

Event Timeline

Daimona updated the task description. (Show Details)

Change 1010923 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] Improve test coverage of PermissionChecker

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

On second thought, I'm not sure if this can be considered a permission thing. Maybe it should be in the behaviour layer instead (i.e., command classes). Need to think about this more.

Change #1010923 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Improve test coverage of PermissionChecker

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

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

[mediawiki/extensions/CampaignEvents@master] Reject permission for actions if on non-local wiki

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

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

[mediawiki/extensions/WikimediaCampaignEvents@master] Edit endpoints to use new signature for permission methods

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

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

[mediawiki/extensions/CampaignEvents@master] refactor permissionChecker methods to take ExistingEventRegistration

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

Change #1025797 merged by Daimona Eaytoy:

[mediawiki/extensions/WikimediaCampaignEvents@master] Edit endpoints to use new signature for permission methods

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

Change #1023831 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Reject permission for actions if on non-local wiki

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

Change #1026099 abandoned by Mhorsey:

[mediawiki/extensions/CampaignEvents@master] refactor permissionChecker methods to take ExistingEventRegistration

Reason:

No longer required

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

vaughnwalters subscribed.

✅ Edit event

Screenshot 2024-05-28 at 4.33.54 PM.png (820×1 px, 118 KB)

✅ Delete event
Screenshot 2024-05-28 at 4.33.26 PM.png (608×1 px, 118 KB)

✅ Register for event
Screenshot 2024-05-28 at 4.31.04 PM.png (910×2 px, 178 KB)

✅ Message participants
✅ Remove participants
✅ View private participants
✅ View participants' non-PII answers
✅ View aggregated answers
Screenshot 2024-05-28 at 4.35.09 PM.png (1×1 px, 312 KB)

Working as expected, sending to product sign off. Noting that Special:EditEventRegistration does not display the same Please edit your event registration on en.wikipedia.beta.wmflabs.org, the wiki where the event was created. that the other special pages display.

ifried subscribed.

The global implementation work is complete and we have released to another wiki (Igbo Wikipedia), so I'm marking this work as Done.

Also, thanks for that catch, @vaughnwalters! I have created a separate ticket to update the language in T366969.

Also, thanks for that catch, @vaughnwalters! I have created a separate ticket to update the language in T366969.

Ah, sorry Ilana to make you write that ticket - I forgot to tag it here that I created a task for that in T366185! I closed the one I made as a duplicate of the one you just created.