From f3b48d0678fe23c8ff4aed8bfdc370b3b8197b9f Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Wed, 4 May 2022 12:08:32 -0400 Subject: Auth levels are now read from a special config file. Both display and operations are now checked for auth level. --- captain/web.f90 | 226 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 140 insertions(+), 86 deletions(-) (limited to 'captain/web.f90') diff --git a/captain/web.f90 b/captain/web.f90 index b990c1a..9d8fc3c 100644 --- a/captain/web.f90 +++ b/captain/web.f90 @@ -70,6 +70,17 @@ contains end function request_is_authenticated + subroutine echo_error_stdout(error_code) + implicit none + + integer, intent(in)::error_code + + Print *, "Falling...

An Error Occurred:" + Print *, error_code + Print *, "

" + + end subroutine echo_error_stdout + subroutine handle_basic_template_components(req, page) use server_response use page_template @@ -151,6 +162,7 @@ contains use captain_db use server_response use request_utils, only: get_player_status_utf8, render_jobs_links, generate_simple_pager + use config, only: global_permissions implicit none type(request)::req @@ -219,14 +231,17 @@ contains res = "

"//trim(instruction_name)//"

" - one_link => html_link(trim(instruction_name)//".json", & - "View Raw") - res = trim(res)//nl//"

"//one_link//"

" - deallocate(one_link) + if(req%auth_level >= global_permissions%get("view-raw-instructions")) then + one_link => html_link(trim(instruction_name)//".json", & + "View Raw") + res = trim(res)//nl//"

"//one_link//"

" + deallocate(one_link) + end if if(n_players == 0) then res = trim(res)//nl//"

No players currently can run these instructions

" - else + + else if(req%auth_level >= global_permissions%get("launch-job")) then res = trim(res)//nl//"

Launch Now

"//nl//"