[jboss-user] [JBoss Seam] - Re: Securing components

rapowder do-not-reply at jboss.com
Tue Jul 3 03:56:45 EDT 2007


Ok I moved my addRole() method to the autenticate method:

    public boolean authenticate() { 
  |         
  |         Identity id = Identity.instance();
  |         User userReference = getUserFromDB(id.getUsername(), id.getPassword());
  |         
  |         if(userReference == null) {
  |             return false;   
  |         }
  |         else {
  |             log.info("Setting role: " + userReference.getRole().name());
  |             id.addRole(userReference.getRole().name());
  |             log.info("Set role " + CoreConstants.UserRole.ADMIN.name() + "? " 
  |                     + id.hasRole(CoreConstants.UserRole.ADMIN.name()));
  |             return true;
  |         }
  |     }

As you can notice I added some debug messages before and after the addRole() method and I noticed that it has no effect, since the output is: 

02:32:37,756 INFO  [LoginAction] Setting role: ADMIN
  | 02:32:37,757 INFO  [LoginAction] Set role ADMIN? false

Any suggestions?


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

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



More information about the jboss-user mailing list