diff options
| author | ckonstanski <carlos.konstanski@olo.com> | 2021-11-27 10:20:12 -0700 |
|---|---|---|
| committer | ckonstanski <carlos.konstanski@olo.com> | 2021-11-27 10:20:12 -0700 |
| commit | 31657f6854edc116946a099be889440fb3e92e53 (patch) | |
| tree | be32747cfaf2f19f59857349438d62fb4a4a25b6 /service/auth-service.lisp | |
| parent | 41ca4dcf8a18a76c48734a5fca4c56afb735a66e (diff) | |
moved everything under lisp/
Diffstat (limited to 'service/auth-service.lisp')
| -rw-r--r-- | service/auth-service.lisp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/service/auth-service.lisp b/service/auth-service.lisp deleted file mode 100644 index 0a84264..0000000 --- a/service/auth-service.lisp +++ /dev/null @@ -1,30 +0,0 @@ -;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- -(declaim (optimize (speed 0) (safety 3) (debug 3))) - -(in-package :ldapadmin) - -(defclass auth-service (rest-service) - () - (:documentation "")) - -(defmethod initialize-instance :after ((auth-service auth-service) &key) - (when (not (string= (session-value :permissions) "admin")) - (setf (location auth-service) "/home") - (setf (errormsg auth-service) "You are not authorized to access this resource."))) - -(defmacro with-auth ((instance auth-service) &body body) - `(let ((,instance (make-instance ',auth-service))) - (when (string= (session-value :permissions) "admin") - ,@body) - (when (location-p ,instance) - (setf (session-value :message) nil) - (setf (session-value :errormsg) nil)) - (org-ckons-json::objects-to-json `(,,instance)))) - -(defmacro with-noauth ((instance rest-service) &body body) - `(let ((,instance (make-instance ',rest-service))) - ,@body - (when (location-p ,instance) - (setf (session-value :message) nil) - (setf (session-value :errormsg) nil)) - (org-ckons-json::objects-to-json `(,,instance)))) |
