aboutsummaryrefslogtreecommitdiff
path: root/captain/response.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2022-05-04 12:08:32 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2022-05-04 12:08:32 -0400
commitf3b48d0678fe23c8ff4aed8bfdc370b3b8197b9f (patch)
treebf547f3a6838bb5079c2e5d22fc58310f4c1155d /captain/response.f90
parentd26549e79053413bf82c510c6fb192289fe7448a (diff)
downloadlevitating-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.f9012
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