did you check EmployeeAccess.java in his classes? Does that look like what 
you're looking for?

  | package examples;
  | 
  | import flashgateway.Gateway;
  | 
  | import javax.servlet.http.HttpServletRequest;
  | import java.security.Principal;
  | 
  | /**
  |  * Object that only users in role "sample-employee" can access.
  |  *
  |  * @author Brian Deitte
  |  */
  | public class EmployeeAccess {
  | 
  |     public TransferObject getTransferObject() {
  | 
  |         TransferObject transfer = new TransferObject();
  |         // use the new 1.5 way of getting request info for RemoteObject
  |         HttpServletRequest request = Gateway.getHttpRequest();
  |         Principal prin = request.getUserPrincipal();
  | 
  |         // the prinicpal should never be null if security is set up right 
but
  |         // we'll test here anyways
  |         if (prin == null) {
  |             throw new RuntimeException("Principal is null- is security set 
up correctly?");
  |         }
  | 
  |         // transfer the user name for display on the client
  |         transfer.userName = prin.getName();
  | 
  |         // it would be nice if we could transfer the role name, but instead 
with the servlet API we
  |         // can only check whether the current user is in a role.
  |         transfer.isManager = 
request.isUserInRole(ManagerAccess.MANAGER_ROLE);
  | 
  |         // we use the role information to decide whether to include salary 
info.  This works because we know the
  |         // user has to log in to access EmployeeAccess.  If they only had 
to log in to access ManagerAccess, then
  |         // we'd have to reget salary information from ManagerAccess.  Doing 
it here instead means we can
  |         // make one less call to the server and transfer all Employee data 
in one logical group
  |         boolean includeSalary = transfer.isManager;
  | 
  |         // transfer the list of Employee objects
  |         transfer.employees = EmployeeStore.getList(includeSalary);
  | 
  |         return transfer;
  |     }
  | }
  | 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3873294#3873294

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3873294


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to