Skip to content
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

Email verification #311

Merged
merged 3 commits into from
Dec 7, 2023
Merged

Email verification #311

merged 3 commits into from
Dec 7, 2023

Conversation

zwolf
Copy link
Member

@zwolf zwolf commented Nov 29, 2023

Adds support for the Panoptes user table attribute confirmed_at; a not-null confirmed_at attr indicates that the user has confirmed their email address. Includes checks of this attribute on all boards for the following action policies:

Discussions: create
Comments: create, update, destroy
Conversations: index, show, create, destroy
Messages: index, show, create

This seems to follow the intentions of both the initial policies and the new restrictions. This could have been done at a higher level (closer to the application controller) where entire verbs would be blocked similarly to how bans are handled. However, this lacks the finer grain control of policies and introduces considerably more complexity in testing. This feels like a good compromise and is similar to how the account age requirement for posting was handled.

This PR requires the corresponding Panoptes PR to merge first. The couple of them will need some hands on testing on staging.

@zwolf zwolf requested a review from yuenmichelle1 November 30, 2023 16:33
Copy link
Collaborator

@yuenmichelle1 yuenmichelle1 left a comment

Choose a reason for hiding this comment

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

Changes make sense to me.

I did have a quick question on requirements of of_posting_age? and whether we still want this moving forward. Not blocking, just wondering.

@@ -11,18 +11,18 @@ def show?

def create?
if Array.wrap(record).compact.any? { |c| c.discussion.board.section == 'zooniverse' }
logged_in? && !locked? && writable? && of_posting_age?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we still want the of_posting_age? restriction now that we have confirmed?

@@ -11,9 +11,9 @@ def show?

def create?
if Array.wrap(record).compact.any? { |d| d.board.section == 'zooniverse' }
writable? && of_posting_age?
writable? && confirmed? && of_posting_age?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we still want the of_posting_age? restriction now that we have confirmed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Leaving this here because we can turn it off via deploy instead of removing the code.

@zwolf zwolf merged commit 04e5cb3 into master Dec 7, 2023
1 check passed
@zwolf zwolf deleted the email-verification branch December 7, 2023 17:41
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.

2 participants