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/menu-service.lisp | |
| parent | 41ca4dcf8a18a76c48734a5fca4c56afb735a66e (diff) | |
moved everything under lisp/
Diffstat (limited to 'service/menu-service.lisp')
| -rw-r--r-- | service/menu-service.lisp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/service/menu-service.lisp b/service/menu-service.lisp deleted file mode 100644 index 728b8e5..0000000 --- a/service/menu-service.lisp +++ /dev/null @@ -1,55 +0,0 @@ -;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- -(declaim (optimize (speed 0) (safety 3) (debug 3))) - -(in-package :ldapadmin) - -(defparameter *menu-config* '((:id "a_menu_home" :label "Home" :handler "/home" :permissions "t") - (:id "a_menu_login" :label "Login" :handler "/login" :permissions "anonymous") - (:id "a_menu_logout" :label "Logout" :handler "/logout" :permissions "admin") - (:id "a_menu_inetorg_view" :label "View InetOrg Entries" :handler "/inetorg/view" :permissions "admin") - (:id "a_menu_inetorg_add" :label "Add InetOrg Entry" :handler "/inetorg/add" :permissions "admin"))) - -(defclass menuitem () - ((id :initarg :id - :initform nil - :accessor id) - (label :initarg :label - :initform nil - :accessor label) - (handler :initarg :handler - :initform nil - :accessor handler) - (permissions :initarg :permissions - :initform nil - :accessor permissions) - (children :initarg :children - :initform nil - :accessor children)) - (:documentation "")) - -(defclass menu-service (base-service) - ((menuitems :initarg :menuitems - :initform nil - :accessor menuitems) - (location-p :initarg :location-p - :initform nil - :accessor location-p)) - (:documentation "")) - -(defmethod initialize-instance :after ((menu-service menu-service) &key) - (setf (menuitems menu-service) - (mapcar (lambda (x) - (make-instance 'menuitem - :id (getf x :id) - :label (getf x :label) - :handler (getf x :handler))) - (remove-if 'null (mapcar (lambda (x) - (when (find-if (lambda (y) - (string= (getf x :permissions) y)) - `("t" ,(session-value :permissions))) - x)) - *menu-config*))))) - -(defun menu-json () - (with-noauth (instance menu-service) - t)) |
