Skip to content

Commit

Permalink
Add assessors and judges to the logs for user type
Browse files Browse the repository at this point in the history
Also update papertrail.
  • Loading branch information
matthewford committed Aug 15, 2024
1 parent ec325c8 commit e5fa578
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ def set_context_tags

private

# Used for ASIM Logging
def set_current_attributes
Current.user_id = current_user&.id || current_admin&.id
Current.user_type = if current_user.present?
Current.user_type = if current_user.present? || current_judge.present? || current_assessor.present?
"User"
elsif current_admin.present?
"Admin"
Expand Down Expand Up @@ -257,9 +258,17 @@ def load_award_year_and_settings

def user_for_paper_trail
if current_admin.present? && current_admin.superadmin?
"SUPERADMIN:#{current_admin.id}"
elsif current_admin.present?
"ADMIN:#{current_admin.id}"
elsif current_assessor.present?
"ASSESSOR:#{current_assessor.id}"
elsif current_judge.present?
"JUDGE:#{current_judge.id}"
elsif current_user.present?
"USER:#{current_user.id}"
else
"UNKNOWN"
end
end

Expand Down

0 comments on commit e5fa578

Please sign in to comment.