From b469063f74582578f5b7a8b4c69c1cb36c47d03e Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Tue, 13 Sep 2022 05:02:30 +0100 Subject: [PATCH] remove code I moved to the nera package from auth package. --- src/auth.lisp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/auth.lisp b/src/auth.lisp index 61db2c4..a5b1f33 100644 --- a/src/auth.lisp +++ b/src/auth.lisp @@ -14,7 +14,6 @@ (:export #:csrf-token #:get-user-roles #:get-current-user - #:get-user-id #:flash-gethash #:auth-user-data)) @@ -45,17 +44,11 @@ (mito:find-dao 'user::user :username username)))) (and user - (= (user::is-administrator-p user) app-constants:+true+) + (= (user::is-administrator-p user) +true+) '(:administrator))))) :session ningle:*session* :denied (constantly '(400 (:content-type "text/plain") ("Authentication denied")))) -;; TODO: MOVE GET-USER OUT OF AUTH PACKAGE (NOT APPLICABLE HERE)) -(defun get-user (username) - "Returns a `USER' profile from the database." - (with-connection (db) - (mito:find-dao 'user :username username))) - (defun get-current-user() "Returns the currently logged in user from the browser session." (with-connection (db) @@ -67,13 +60,6 @@ :roles ,(auth:get-user-roles) :user ,(auth:get-current-user))) -;; TODO: MOVE GET-USER-ID OUT OF AUTH PACKAGE (NOT APPLICABLE HERE)) -(defun get-user-id (username) - "Returns the Id. number of the specified `USERNAME' in the database." - (with-connection (db) - (mito:object-id - (mito:find-dao 'user :username username)))) - (defun get-user-roles() "Returns a list of roles the current user has assigned to them. This is mostly to check if the user is logged-in or has administration