summaryrefslogtreecommitdiff
path: root/service/menu.lisp
diff options
context:
space:
mode:
authorckonstanski <ckonstanski@pippiandcarlos.com>2020-12-21 08:59:56 -0700
committerckonstanski <ckonstanski@pippiandcarlos.com>2020-12-21 08:59:56 -0700
commit0ed1cba1b39daaf8eef693233f081b455c88dece (patch)
tree0322ba1444ef724d4613e3c26ed2679e71bf1882 /service/menu.lisp
parentbac1df6134eee78b79810d13c71a2b22b4739a12 (diff)
stuff
Diffstat (limited to 'service/menu.lisp')
-rw-r--r--service/menu.lisp57
1 files changed, 0 insertions, 57 deletions
diff --git a/service/menu.lisp b/service/menu.lisp
deleted file mode 100644
index 069cb11..0000000
--- a/service/menu.lisp
+++ /dev/null
@@ -1,57 +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" :url "/home" :handler "/home" :permission "t")
- (:id "a_menu_login" :label "Login" :url "/login" :handler "/login" :permission "anonymous")
- (:id "a_menu_logout" :label "Logout" :url "/logout" :handler "/logout" :permission "admin")
- (:id "a_menu_inetorg_view" :label "View InetOrg Entries" :url "/inetorg/view" :handler "/inetorg/view" :permission "admin")
- (:id "a_menu_inetorg_add" :label "Add InetOrg Entry" :url "/inetorg/add" :handler "/inetorg/add" :permission "admin")))
-
-(defclass menuitem ()
- ((id :initarg :id
- :initform nil
- :accessor id)
- (label :initarg :label
- :initform nil
- :accessor label)
- (url :initarg :url
- :initform nil
- :accessor url)
- (handler :initarg :handler
- :initform nil
- :accessor handler)
- (permissions :initarg :permissions
- :initform nil
- :accessor permissions)
- (children :initarg :children
- :initform nil
- :accessor children))
- (:documentation ""))
-
-(defclass menu (base-service)
- ((menuitems :initarg :menuitems
- :initform nil
- :accessor menuitems))
- (:documentation ""))
-
-(defmethod initialize-instance :after ((menu menu) &key)
- (setf (menuitems menu)
- (mapcar (lambda (x)
- (make-instance 'menuitem
- :id (getf x :id)
- :label (getf x :label)
- :url (getf x :url)
- :handler (getf x :handler)))
- (remove-if 'null (mapcar (lambda (x)
- (when (find-if (lambda (y)
- (string= (getf x :permission) y))
- `("t" ,(session-value :permissions)))
- x))
- *menu-config*)))))
-
-(defun menu-json ()
- (objects-to-json `(,(make-instance 'menu))))