Need APIs for getUserPrincipal/isUserInRole, when a custom LoginHandler is 
configured
-------------------------------------------------------------------------------------

         Key: BEEHIVE-941
         URL: http://issues.apache.org/jira/browse/BEEHIVE-941
     Project: Beehive
        Type: Improvement
  Components: NetUI  
    Versions: V1    
    Reporter: Rich Feit
 Assigned to: Rich Feit 
     Fix For: TBD


This was identified by Adam Jenkins.  If you override container-managed login 
handling using your own LoginHandler, there's currently no easy way to get the 
current logged-in user, or to test whether the user is in a particular role.  
You need to do something like this:

    FlowControllerHandlerContext fcContext = new 
FlowControllerHandlerContext(getRequest(), getResponse(), this);
    boolean loggedIn = 
(Handlers.get(getServletContext()).getLoginHandler().getUserPrincipal(fcContext)
 != null);

There should be some methods on FlowController, which would be sensitive to a 
custom LoginHandler:

    protected UserPrincipal getUserPrincipal();
    protected boolean isUserInRole(String roleName);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to