Skip to content

Commit

Permalink
Fix rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
raul-gracia committed Oct 24, 2023
1 parent 6022987 commit bc5ac94
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/system_admin/applicants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def find_applicant

def check_user_roles
unless current_user.has_role?(:servant)
redirect_to(root_path, alert: "You do not have permission to access this page")
redirect_to(root_path, alert: t("errors.access_denied"))
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/system_admin/reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def check_user_roles
case params[:id]
when "home_office", "standing_data", "payroll"
unless current_user.has_role?(:manager)
redirect_to(root_path, alert: "You do not have permission to access this page")
redirect_to(root_path, alert: t("errors.access_denied"))
end
when "applications", "qa"
unless current_user.has_role?(:admin)
redirect_to(root_path, alert: "You do not have permission to access this page")
redirect_to(root_path, alert: t("errors.access_denied"))
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ en:
success: 'User was successfully removed.'
omniauth_callbacks:
no_account: 'You have not yet an account!'
errors:
access_denied: 'You do not have permission to access this page'

0 comments on commit bc5ac94

Please sign in to comment.