Skip to Content.
Sympa Menu

grouper-dev - hooks wrapped up

Subject: Grouper Developers Forum

List archive

hooks wrapped up

Chronological Thread 
  • From: Chris Hyzer <>
  • To: "" <>
  • Subject: hooks wrapped up
  • Date: Sun, 20 Jul 2008 17:37:42 -0400
  • Accept-language: en-US
  • Acceptlanguage: en-US



I wrapped up all my to do’s with hooks, so I consider this pass done.  Let me know if there are more tasks.


Here are the final things I did:


1.       Finalize how data is assigned in HooksContext and passed around to asynchronous hooks.  You can read about here at the end of API section (and below in email):


2.       Integrate hook context setting and veto handling in UI, GSH, and WS.  All of these make the current user available, set the app name in the context, and handle hooks relatively gracefully.  Each will communicate the veto and reason back to the user.  I tested all of them.

3.       I finished up the membership hook where it wont allow membership additions to grouper-loader groups, unless the user is a wheel group member


4.       I added TomZ’s idea of a built-in hook that validates group attributes based on regex configured in


Now I will move on to other things: changing java package structure, integreating GSH / loader / usdu into grouper source tree, ddl rewrite, remove superfluous ID cols from db.








Ps. Here is how data is passed around in hooks:


The HooksContext contains a map of attributes.  These attributes can be set with static methods in HooksContext, and each attribute is designated as allowed to be copied to another thread or not.  e.g. the HttpServletRequest is only valid during a request, so it shouldnt be available in another thread which might last longer than the request.  There are some constants in HooksContext for common keys.  Some of the built-in values for the attributes are: HttpServletRequest, HttpServletResponse, HttpSession (Http classes for UI and WS only).  The hooks context also holds the current context name.  This is retrieved with hooksContext.getGrouperContextType().  This can be assigned (with static method in GrouperContextTypeBuiltIn) in the current thread or global default.  This is available everywhere in grouper, not just hooks.  If it is not set, it is UNKNOWN.  Also the current user is available from the context.  There is the logged in user, the actAs user (perhaps WS only), and the GrouperSession user.  You can make decisions based on which user is using the app.  There are also convenience methods (e.g. boolean hooksContext.isSubjectFromGrouperSessionInGroup(groupName))

  • hooks wrapped up, Chris Hyzer, 07/20/2008

Archive powered by MHonArc 2.6.16.

Top of Page