diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2022-05-04 12:08:32 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2022-05-04 12:08:32 -0400 |
commit | f3b48d0678fe23c8ff4aed8bfdc370b3b8197b9f (patch) | |
tree | bf547f3a6838bb5079c2e5d22fc58310f4c1155d /captain/response.f90 | |
parent | d26549e79053413bf82c510c6fb192289fe7448a (diff) | |
download | levitating-f3b48d0678fe23c8ff4aed8bfdc370b3b8197b9f.tar.gz levitating-f3b48d0678fe23c8ff4aed8bfdc370b3b8197b9f.zip |
Auth levels are now read from a special config file. Both display and operations are now checked for auth level.
Diffstat (limited to 'captain/response.f90')
-rw-r--r-- | captain/response.f90 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/captain/response.f90 b/captain/response.f90 index 34c537c..e172cc1 100644 --- a/captain/response.f90 +++ b/captain/response.f90 @@ -73,6 +73,8 @@ implicit none character(len=:), pointer::token => null() character(len=4)::method = "GET" + integer::auth_level + type(query)::q type(cookies)::c @@ -111,6 +113,8 @@ contains subroutine request_init(self, str, server_explicit, protocol_explicit, method, cookiestring) use logging use utilities, only: toupper + use captain_db, only: get_session_auth_db + use auth_levels, only: AUTH_NONE implicit none class(request) :: self @@ -222,6 +226,14 @@ contains if(.not.associated(self%token) .and. associated(self%c%get_value("token"))) then self%token => self%c%get_value("token") end if + else + call self%c%init() + end if + + if(associated(self%token)) then + self%auth_level = get_session_auth_db(self%token) + else + self%auth_level = AUTH_NONE end if end subroutine request_init |