Page MenuHomePhabricator

Require that a user is in the electionadmin group in order to be an admin for a poll [M]
Closed, ResolvedPublic3 Estimated Story Points

Description

Only trusted users should be able to be added as an admin for a particular poll. This is currently not enforced in the software, so must be checked manually by the person who adds the admin to the election.

The form should only allow trusted users to become poll admins, by requiring that admins are in the electionadmin group. This should be enforced by the UsersMultiselectWidget after T270634.

Event Timeline

Should the user right be automatically removed upon beginning of a poll?

We want only people with election-admin right to be allowed to be added as poll admins. Only people who are poll admin on an election and have the election-admin right should be allowed to modify a poll.
Election admins should be given temporary rights when assigning them the rights.

Should the user right be automatically removed upon beginning of a poll?

Election admins should be given temporary rights when assigning them the rights.

From @jrbs: no need for the software to do this if it does everything else in T271327#6726468 (correct me if I'm wrong!)

Tchanders renamed this task from Require that a user has a specific right in order to be an election admin to Require that a user has electionadmin right in order to be an admin for a poll.EditedJan 6 2021, 6:47 PM
Tchanders updated the task description. (Show Details)

We want only people with election-admin right to be allowed to be added as poll admins.

This task

Only people who are poll admin on an election and have the election-admin right should be allowed to modify a poll.

Filed as T271354

Tchanders renamed this task from Require that a user has electionadmin right in order to be an admin for a poll to Require that a user is in the electionadmin group in order to be an admin for a poll.Jan 6 2021, 8:17 PM
Tchanders updated the task description. (Show Details)

Change 655021 had a related patch set uploaded (by STran; owner: STran):
[mediawiki/extensions/SecurePoll@master] Use UsersMultiselectWidget to set election admins and validate that users are members of the electionadmin group

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

Change 655021 merged by jenkins-bot:
[mediawiki/extensions/SecurePoll@master] Update admin selection input for SecurePoll create/edit

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

Change 655481 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/SecurePoll@master] Fix message key in CreatePage validation callback

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

Change 655481 merged by jenkins-bot:
[mediawiki/extensions/SecurePoll@master] Fix message key in CreatePage validation callback

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

dom_walden subscribed.

You can only add a user as admin to a poll if they are in the electionadmin group.

This applies both when creating for the first time and when submitting an edit to the election. If a user gets removed from the electionadmin group in the mean-time, you will need to remove them as an election admin if you want to edit the election.

We only check the groups a user is a member of on the wiki we are creating the election on.

If, for example, we create the election on votewiki but it is "for" enwiki, only the user rights on votewiki will matter (for the purposes of creating an election at least). (I don't yet know how this functionality works or gets used.)

As far as I could tell, electionadmin only appears to be a local group, it is not a global group, so there does not seem to be any added complexity here.

I tested this both with and without javascript.

Test Environment: local vagrant MediaWiki 1.36.0-alpha (f4c63c6), SecurePoll 2.0.0 (828f8d9).
Test Browser: Firefox 78.

tstarling subscribed.

The patch is not how permissions are meant to be done. You should have a right for this and have the group grant the right. There should not be any group named in the code. Like @Niharika said:

We want only people with election-admin right to be allowed to be added as poll admins. Only people who are poll admin on an election and have the election-admin right should be allowed to modify a poll.
Election admins should be given temporary rights when assigning them the rights.

By default, all users should have the right, because as far as I can see, this is a WMF-specific hack which makes it a nuisance for anyone else to use the extension.

ARamirez_WMF renamed this task from Require that a user is in the electionadmin group in order to be an admin for a poll to Require that a user is in the electionadmin group in order to be an admin for a poll [M].Sep 1 2021, 4:21 PM
ARamirez_WMF set the point value for this task to 3.
ARamirez_WMF subscribed.

@STran did I put this in the right place? I might have misplaced this task as I was creating our new sprint board

Shouldn't this one have been closed in favor of T293015: Check for the election-admin right instead of the electionadmin group? Also is AHT still working on SecurePoll things?

jrbs triaged this task as High priority.Sep 23 2022, 10:33 PM
jrbs moved this task from Backlog to Needs evaluation on the MediaWiki-extensions-SecurePoll board.
Aklapper added a subscriber: STran.

@STran: Removing task assignee as this open task has been assigned for more than two years - See the email sent to task assignee on Feburary 22nd, 2023.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!

Pppery assigned this task to STran.
Pppery subscribed.

Closing as resolved as this was reopened due to an issue now tracked in another task.