Skip to content

Commit

Permalink
Remove old admin panel (#10645)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljames-dj authored Jan 16, 2025
1 parent d5dafa0 commit 5a34c27
Show file tree
Hide file tree
Showing 18 changed files with 391 additions and 392 deletions.
20 changes: 19 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,15 @@ def self.panel_pages
:editPersonRequests,
:anonymizationScript,
:serverStatus,
:runValidators,
:createNewComers,
:checkRecords,
:computeAuxiliaryData,
:generateDataExports,
:fixResults,
:mergeProfiles,
:anonymizePerson,
:reassignConnectedWcaId,
].index_with { |panel_page| panel_page.to_s.underscore.dasherize }
end

Expand All @@ -662,7 +671,7 @@ def self.panel_list
panel_pages = User.panel_pages
{
admin: {
name: 'New Admin panel',
name: 'Admin panel',
pages: panel_pages.values,
},
staff: {
Expand Down Expand Up @@ -701,6 +710,15 @@ def self.panel_list
panel_pages[:editPerson],
panel_pages[:approveAvatars],
panel_pages[:anonymizationScript],
panel_pages[:runValidators],
panel_pages[:createNewComers],
panel_pages[:checkRecords],
panel_pages[:computeAuxiliaryData],
panel_pages[:generateDataExports],
panel_pages[:fixResults],
panel_pages[:mergeProfiles],
panel_pages[:anonymizePerson],
panel_pages[:reassignConnectedWcaId],
],
},
wst: {
Expand Down
29 changes: 0 additions & 29 deletions app/views/admin/_nav.html.erb

This file was deleted.

177 changes: 87 additions & 90 deletions app/views/admin/anonymize_person.html.erb
Original file line number Diff line number Diff line change
@@ -1,122 +1,119 @@
<% provide(:title, 'Anonymize Person') %>

<div class="container">
<%= render layout: "nav" do %>
<h1><%= yield(:title) %></h1>

<p>This process will take you through the steps required to anonymize a WCA Profile. This action is IRREVERSIBLE and any future results they earn through official competitions will result in a new WCA ID assignment and will not be linked to any previous official results earned before the removal of their data.</p>
<p>Before processing any anonymization requests, WRT must receive verification with a picture/copy of an official ID verification (passport, driver's license, etc.) with a minimum of their name and birthday (any other information may be blurred-out/obfuscated).</p>
<p>After going through the initial steps of requesting data removal from data processors, by clicking confirm:</p>
<p>- A new WCA ID will be generated (removing any form of the persons name from the WCAID).</p>
<p>- Personally identifiable information (PII) in the users, Results, and Persons tables will be anonymized.</p>
<p>- This PII includes: name, DOB, email, avatar, gender, and IP addresses).</p>

<%= simple_form_for @anonymize_person, url: admin_anonymize_person_path do |f| %>
<% if @anonymize_person.current_step == AnonymizePerson::STEP_1 %>
<%= f.input :person_wca_id, as: :user_ids, persons_table: true, only_one: true, label: "Person to Anonymize" %>
<% elsif @anonymize_person.current_step == AnonymizePerson::STEP_2 %>
<% is_currently_banned = @anonymize_person.account&.banned? %>
<% banned_in_the_past = @anonymize_person.account&.banned_in_past? %>
<% records = @anonymize_person.person.records %>
<% championship_podiums = @anonymize_person.person.championship_podiums %>
<h4>Important information to consider before proceeding:</h4>
<ol>
<% if is_currently_banned %>
<li>This person is currently banned and cannot be anonymized.</li>
<% elsif banned_in_the_past %>
<li>This person has been banned in the past, please email WIC and WRT to discuss whether to proceed with the anonymization</li>
<% else %>
<li>This person has never been banned.</li>
<% end %>
<% if records[:total] > 0 %>
<li>This person has held <%= records[:world] %> World Records, <%= records[:continental] %> Contential Records, and <%= records[:national] %> National Records</li>
<% else %>
<li>This person has never held any records.</li>
<% end %>
<% if championship_podiums[:world].any? || championship_podiums[:continental].any? || championship_podiums[:national].any? %>
<li>This person has achieved World Championship podium <%= championship_podiums[:world].size %> times, Continental Championship podium <%= championship_podiums[:continental].size %> times, and National Championship podium <%= championship_podiums[:national].size %> times.</li>
<% else %>
<li>This person has never been on the podium at the World, Continental, or National Championships.</li>
<% end %>
</ol>
<h4>Request Data Removal from data processors</h4>
<ol>
<li>For recently competed competitions (Past 3 months), verify with the delegates that there is nothing outstanding regarding the competitor's involvement in these WCA competitions:</li>
<% recent_competitions_3_months = @anonymize_person.person.competitions.select{ |c| c.start_date > (Date.today - 3.month) } %>

<% if recent_competitions_3_months.any? %>
<h1>Anonymize person</h1>

<p>This process will take you through the steps required to anonymize a WCA Profile. This action is IRREVERSIBLE and any future results they earn through official competitions will result in a new WCA ID assignment and will not be linked to any previous official results earned before the removal of their data.</p>
<p>Before processing any anonymization requests, WRT must receive verification with a picture/copy of an official ID verification (passport, driver's license, etc.) with a minimum of their name and birthday (any other information may be blurred-out/obfuscated).</p>
<p>After going through the initial steps of requesting data removal from data processors, by clicking confirm:</p>
<p>- A new WCA ID will be generated (removing any form of the persons name from the WCAID).</p>
<p>- Personally identifiable information (PII) in the users, Results, and Persons tables will be anonymized.</p>
<p>- This PII includes: name, DOB, email, avatar, gender, and IP addresses).</p>

<%= simple_form_for @anonymize_person, url: admin_anonymize_person_path do |f| %>
<% if @anonymize_person.current_step == AnonymizePerson::STEP_1 %>
<%= f.input :person_wca_id, as: :user_ids, persons_table: true, only_one: true, label: "Person to Anonymize" %>
<% elsif @anonymize_person.current_step == AnonymizePerson::STEP_2 %>
<% is_currently_banned = @anonymize_person.account&.banned? %>
<% banned_in_the_past = @anonymize_person.account&.banned_in_past? %>
<% records = @anonymize_person.person.records %>
<% championship_podiums = @anonymize_person.person.championship_podiums %>
<h4>Important information to consider before proceeding:</h4>
<ol>
<% if is_currently_banned %>
<li>This person is currently banned and cannot be anonymized.</li>
<% elsif banned_in_the_past %>
<li>This person has been banned in the past, please email WIC and WRT to discuss whether to proceed with the anonymization</li>
<% else %>
<li>This person has never been banned.</li>
<% end %>
<% if records[:total] > 0 %>
<li>This person has held <%= records[:world] %> World Records, <%= records[:continental] %> Contential Records, and <%= records[:national] %> National Records</li>
<% else %>
<li>This person has never held any records.</li>
<% end %>
<% if championship_podiums[:world].any? || championship_podiums[:continental].any? || championship_podiums[:national].any? %>
<li>This person has achieved World Championship podium <%= championship_podiums[:world].size %> times, Continental Championship podium <%= championship_podiums[:continental].size %> times, and National Championship podium <%= championship_podiums[:national].size %> times.</li>
<% else %>
<li>This person has never been on the podium at the World, Continental, or National Championships.</li>
<% end %>
</ol>
<h4>Request Data Removal from data processors</h4>
<ol>
<li>For recently competed competitions (Past 3 months), verify with the delegates that there is nothing outstanding regarding the competitor's involvement in these WCA competitions:</li>
<% recent_competitions_3_months = @anonymize_person.person.competitions.select{ |c| c.start_date > (Date.today - 3.month) } %>

<% recent_competitions_3_months.each do |c| %>
<div>Contact <%= link_to c.display_name(short: true), competition_path(c) %> - <%= mail_to c.delegates.map(&:email).join(", "), name = c.delegates.map(&:name).join(", ") %></div>
<% end %>
<% if recent_competitions_3_months.any? %>

<% else %>
<div>No recent competitions to check.</div>
<% recent_competitions_3_months.each do |c| %>
<div>Contact <%= link_to c.display_name(short: true), competition_path(c) %> - <%= mail_to c.delegates.map(&:email).join(", "), name = c.delegates.map(&:name).join(", ") %></div>
<% end %>

<br>
<% else %>
<div>No recent competitions to check.</div>
<% end %>

<% if @anonymize_person.account %>
<li>If you are an administrator of the WCA forum, search active users (https://forum.worldcubeassociation.org/admin/users/list/active) for any users using this email and anonymize their data. If you are not an administrator of the WCA forum, please ask a WRT member with administrator access to perform this step.</li>
<br>
<li>Request data removal from OAuth Access Grants.</li>
<% access_grants = @anonymize_person.account.oauth_access_grants.select { |access_grant| !access_grant.revoked_at.nil? } %>
<br>

<% if access_grants.any? %>
<% if @anonymize_person.account %>
<li>If you are an administrator of the WCA forum, search active users (https://forum.worldcubeassociation.org/admin/users/list/active) for any users using this email and anonymize their data. If you are not an administrator of the WCA forum, please ask a WRT member with administrator access to perform this step.</li>
<br>
<li>Request data removal from OAuth Access Grants.</li>
<% access_grants = @anonymize_person.account.oauth_access_grants.select { |access_grant| !access_grant.revoked_at.nil? } %>

<% access_grants.each do |grant| %>
<div><%= grant.application.name %> - <%= grant.application.redirect_uri %> - <%= mail_to grant.application.owner.email, name = grant.application.owner.name %></div>
<% end %>
<% if access_grants.any? %>

<% else %>
<div>No OAuth Applications to check.</div>
<% access_grants.each do |grant| %>
<div><%= grant.application.name %> - <%= grant.application.redirect_uri %> - <%= mail_to grant.application.owner.email, name = grant.application.owner.name %></div>
<% end %>

<% else %>
<li>Request data anonymization from WCA Forum. (Skip - the WCA ID does not have an account associated with it)</li>
<br>
<li>Request data removal from OAuth Access Grants. (Skip - the WCA ID does not have an account associated with it)</li>
<div>No OAuth Applications to check.</div>
<% end %>

<% else %>
<li>Request data anonymization from WCA Forum. (Skip - the WCA ID does not have an account associated with it)</li>
<br>
<li>Inspect external websites of competitions for data usage. If so, instruct the website to remove the person's data.</li>
<% competitions_with_external = @anonymize_person.person.competitions.select{ |c| c.external_website } %>
<li>Request data removal from OAuth Access Grants. (Skip - the WCA ID does not have an account associated with it)</li>
<% end %>

<% if competitions_with_external.any? %>
<br>
<li>Inspect external websites of competitions for data usage. If so, instruct the website to remove the person's data.</li>
<% competitions_with_external = @anonymize_person.person.competitions.select{ |c| c.external_website } %>

<% competitions_with_external.each do |c| %>
<div><%= link_to c.display_name(short: true), competition_path(c) %> - <%= link_to c.external_website, c.external_website %> - <%= mail_to c.delegates.map(&:email).join(", "), name = c.delegates.map(&:name).join(", "), cc: UserGroup.teams_committees_group_wrt.metadata.email, subject: "Anonymization Request" %></div>
<% end %>
<% if competitions_with_external.any? %>

<% else %>
<div>No Competitions with external websites to check.</div>
<% competitions_with_external.each do |c| %>
<div><%= link_to c.display_name(short: true), competition_path(c) %> - <%= link_to c.external_website, c.external_website %> - <%= mail_to c.delegates.map(&:email).join(", "), name = c.delegates.map(&:name).join(", "), cc: UserGroup.teams_committees_group_wrt.metadata.email, subject: "Anonymization Request" %></div>
<% end %>

<br>
<li>For recently competed competitions (Past 1 month), after anonymizing the person's data, synchrozie the results on <%= link_to "WCA Live", "https://live.worldcubeassociation.org" %>:</li>
<% recent_competitions_1_month = @anonymize_person.person.competitions.select{ |c| c.start_date > (Date.today - 1.month) } %>
<% else %>
<div>No Competitions with external websites to check.</div>
<% end %>

<% if recent_competitions_1_month.any? %>
<br>
<li>For recently competed competitions (Past 1 month), after anonymizing the person's data, synchrozie the results on <%= link_to "WCA Live", "https://live.worldcubeassociation.org" %>:</li>
<% recent_competitions_1_month = @anonymize_person.person.competitions.select{ |c| c.start_date > (Date.today - 1.month) } %>

<% recent_competitions_1_month.each do |c| %>
<div><%= link_to c.display_name(short: true), competition_path(c) %></div>
<% end %>
<% if recent_competitions_1_month.any? %>

<% else %>
<div>No recent competitions to sync.</div>
<% recent_competitions_1_month.each do |c| %>
<div><%= link_to c.display_name(short: true), competition_path(c) %></div>
<% end %>
</ol>
<br>
<% end %>

<div>
<%= f.submit "Back", :class => "btn btn-primary", :name => "back_button" unless @anonymize_person.first_step? %>
<%= f.submit "Next Step", :class => "btn btn-primary" unless @anonymize_person.last_step? %>
<% unless is_currently_banned %>
<%= f.submit "Confirm", :class => "btn btn-success", data: { confirm: "Are you sure you want to anonymize this person? All personal data will be removed from WCA once confirmed." } if @anonymize_person.last_step? %>
<% else %>
<div>No recent competitions to sync.</div>
<% end %>
</div>
</ol>
<br>
<% end %>

<div>
<%= f.submit "Back", :class => "btn btn-primary", :name => "back_button" unless @anonymize_person.first_step? %>
<%= f.submit "Next Step", :class => "btn btn-primary" unless @anonymize_person.last_step? %>
<% unless is_currently_banned %>
<%= f.submit "Confirm", :class => "btn btn-success", data: { confirm: "Are you sure you want to anonymize this person? All personal data will be removed from WCA once confirmed." } if @anonymize_person.last_step? %>
<% end %>
</div>
<% end %>
</div>
Loading

0 comments on commit 5a34c27

Please sign in to comment.