[ http://issues.apache.org/jira/browse/BEEHIVE-941?page=all ]
     
Julie Zhuo closed BEEHIVE-941:
------------------------------


There is a valid junit bvt test for this - LoginTest that has been passing. 
Close.

> 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
>     Assignee: Julie Zhuo
>      Fix For: 1.1

>
> 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