Skip to content

Commit

Permalink
Allow user to access their own DOB
Browse files Browse the repository at this point in the history
  • Loading branch information
maxidragon committed Jan 13, 2025
1 parent d3889ef commit 1f1a06e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/v0/persons_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def index
def show
person = Person.current.includes(:user, :ranksSingle, :ranksAverage).find_by_wca_id!(params[:wca_id])
private_attributes = []
if current_user && current_user.can_admin_results?
if current_user && (current_user.can_admin_results? || current_user&.person == person)
private_attributes = %w[incorrect_wca_id_claim_count dob]
end
render json: person_to_json(person, private_attributes)
Expand Down

0 comments on commit 1f1a06e

Please sign in to comment.