
Author: achiumenti Date: Fri Feb 15 06:13:45 2008 New Revision: 6 Modified: trunk/main/claw-core/src/misc.lisp Log: added some comments Modified: trunk/main/claw-core/src/misc.lisp ============================================================================== --- trunk/main/claw-core/src/misc.lisp (original) +++ trunk/main/claw-core/src/misc.lisp Fri Feb 15 06:13:45 2008 @@ -70,25 +70,32 @@ (setf result (push location-cons cons-list)))) (defun current-realm (&optional (request *request*)) + "Returns the realm under which the request has been sent" (aux-request-value 'realm request)) (defun current-lisplet (&optional (request *request*)) + "Returns the lisplet instance from which the request comes from" (aux-request-value 'lisplet request)) (defun current-server (&optional (request *request*)) + "Returns the clawserver instance from which the request comes from" (aux-request-value 'clawserver request)) (defun current-principal (&optional (session *session*)) + "Returns the principal(user) that logged into the application" (when session - (session-value 'principal))) + (session-value 'principal session))) (defun user-in-rolep (roles &optional (session *session*)) + "Detects if current principal belongs to any of the expressed roles" (let ((principal (current-principal session))) (when principal (loop for el in (principal-roles principal) thereis (member el roles))))) (defun current-config (&optional (request *request*)) - (gethash (current-realm request) (clawserver-login-config (current-server)))) + "Returns the current configuration object for the realm of the request" + (gethash (current-realm request) (clawserver-login-config (current-server request)))) (defun login (&optional (request *request*)) + "Perfoms a login action using the configuration object given for the request realm" (configuration-login (current-config request))) \ No newline at end of file