users: add Restricted user level.
Add a Restricted user level. Restricted users are level 10, below Members. New users start out as Restricted if they sign up from a proxy or an IP recently used by another user. Restricted users can't update or edit any public content on the site until they verify their email address, at which point they're promoted to Member. Restricted users are only allowed to do personal actions like keep favorites, keep favgroups and saved searches, mark dmails as read or deleted, or mark forum posts as read. The restricted state already existed before, the only change here is that now it's an actual user level instead of a hidden state. Before it was based on two hidden flags on the user, the `requires_verification` flag (set when a user signs up from a proxy, etc), and the `is_verified` flag (set after the user verifies their email). Making it a user level means that now the Restricted status will be shown publicly. Introducing a new level below Member means that we have to change every `is_member?` check to `!is_anonymous` for every place where we used `is_member?` to check that the current user is logged in.
This commit is contained in:
@@ -49,7 +49,7 @@ class EmailsController < ApplicationController
|
||||
redirect_to edit_user_email_path(@user)
|
||||
elsif params[:email_verification_key].present?
|
||||
authorize @email_address
|
||||
@email_address.update!(is_verified: true)
|
||||
@email_address.verify!
|
||||
flash[:notice] = "Email address verified"
|
||||
redirect_to @email_address.user
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user