8000 Implement forum age restriction by dunkOnIT · Pull Request #11380 · thewca/worldcubeassociation.org · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Implement forum age restriction #11380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

dunkOnIT
Copy link
Contributor

In the email thread "Adding Age Requirement to WCA Forum", WCT has requested that we implement an age requirement of 13 years old for signing up to the forum - this will align us with COPPA. From a data protection perspective, WRT confirmed that we can use age data to enforce this type of restriction.

This PR blocks SSO if the user's age is below 13, following a similar pattern to how we prevent banned users from registering. Importantly, this PR also adds a misc category for i18n keys - I couldn't see a better category to put a one-off forum key in.

Copy link
Member
@gregorbg gregorbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really care about the I18N key (ie it's fine by me).

The much less trivial change about this feature is that we now require users to have an associated WCA ID in order to use the forums. Otherwise we don't have any (verified) DOB information. Details are in my inline code comments.

def banned?
group_member?(UserGroup.banned_competitors.first)
def age_in_years
age = Date.today.year - dob.year
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dob is not necessarily set. Users who "just" sign up without ever having competed before are not required to enter their DOB.

This value is only "backfilled" as part of the "Claim WCA ID" process. Note that users can claim a WCA ID directly while signing up/creating their account, but that doesn't change the fact that this field is only filled if a WCA ID has been claimed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, interesting. Obviously I need to add nil support, but more deeply we need to get a clear set of requirements from WCT on how to handle this - requested via email

group_member?(UserGroup.banned_competitors.first)
def age_in_years
age = Date.today.year - dob.year
age -= 1 if Date.today < dob.advance(years: age)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What?!

8000
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restructured to make it easier to grok - originally, this was advancing the dob to the current year to compare the current date to the user's date of birth. New version makes that more explicit

Comment on lines +509 to +512
def banned?
group_member?(UserGroup.banned_competitors.first)
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels unrelated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just moving around the method, so that the two forum-related methods are adjacent to each other - ie, banned? moved below forum_banned?

@gregorbg
Copy link
Member

Setting this to draft until the issues around WCA IDs have been resolved.

@gregorbg gregorbg marked this pull request as draft April 22, 2025 04:56
@lnzainn
Copy link
Contributor
lnzainn commented Apr 26, 2025

@gregorbg @dunkOnIT we have discussed and the consensus is to allow users to access it as long as they have provided date of birth that is > 13 and that having WCA ID is not mandatory.

@gregorbg
8000
Copy link
Member

Thank you, this unfortunately makes the implementation a bit more tricky because we currently don't store DOBs for users who have never competed before. It's not rocket science to add this feature, and the Board is also strongly in favor of prioritizing this PR/feature, but it will still take a non-trivial amount of time to figure this one out.

@dunkOnIT dunkOnIT added the STATUS: blocked Progress cannot continue - reason for block should be specified in comments label Apr 27, 2025
@dunkOnIT
Copy link
Contributor Author

Marked as blocked until we come to consensus on:

  • priority of this feature from the Board's perspective
  • implications for WCA's data model more broadly if date of birth information can be stored pre-verification from delegates

@dunkOnIT dunkOnIT removed the STATUS: blocked Progress cannot continue - reason for block should be specified in comments label May 5, 2025
@dunkOnIT
Copy link
Contributor Author
dunkOnIT commented May 5, 2025

Unblocked per Callum's email in "Adding Age Requirement to WCA Forum".

My latest commit redirects the user to the Edit Profile if their dob is not filled in, and prompts them to do populate it with a flash message - this should be sufficient to bring the PR in line with requirements

Tested locally to make sure that:

  • user without dob gets redirected to the Edit Profile page
  • user can save their dob
  • once they have a dob, if under 13 they will be blocked from SSO'ing with the forum, with a flash message explaining why
  • the user is still able to edit their dob, but as discussed in the email thread, this is outside our scope to try and enforce/prevent

@dunkOnIT dunkOnIT marked this pull request as ready for review May 5, 2025 16:07
@gregorbg
Copy link
Member
gregorbg commented May 5, 2025

Implementation looks good code-wise. Do we really want to redirect people to the edit form if they don't have a DOB set? That's like inviting them to cheat and fill in a fantasy value.

@dunkOnIT
Copy link
Contributor Author
dunkOnIT commented May 5, 2025

At the point of redirecting them, we aren't telling them that there's an age restriction - only that they need a dob, and I think redirecting them to the edit panel is nice QOL in that context.

Only once they have a dob, do we then tell them that they can't access the forum - and that message redirects them to a new session, not to the edit page.

Copy link
Member
@gregorbg gregorbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please coordinate with WCT whether and when this should be merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0