Extend indentity
elkarel Nov 25, 2010 12:45 PMHi all, I have a problem with extending the Seam Identity...
I followed the manual from:
http://docs.jboss.org/seam/2.1.0.CR1/reference/en-US/html/security.html
However it appears that seam does not use my Identity... Any ideas what it could be? I did full clean, deleted any folder that might contain some elder deploys...
I use seam 2.2 and JBoss 5.1 (unfortunately have to use this versions)
package company.scm.security;
import java.util.HashMap;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Startup;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import org.jboss.seam.security.Identity;
import static org.jboss.seam.annotations.Install.APPLICATION;
@Name("org.jboss.seam.security.identity")
@Scope(ScopeType.SESSION)
@Install(precedence = APPLICATION)
@BypassInterceptors
@Startup
public class SCMIdentity extends Identity {
private static final long serialVersionUID = 1L;
private static final LogProvider log = Logging.getLogProvider(SCMIdentity.class);
private HashMap<String, Boolean> permissions;
private String userRole;
@In(create=true)
PermissionGranter permissionGranter;
@Override
public String login() {
System.out.println("CUSTOM LOGIN CALLED");
String loginString;
loginString = super.login();
if(loginString!=null){
userRole = permissionGranter.getUserRole(getCredentials().getUsername());
permissions = permissionGranter.getPermissionsList(userRole);
}
return loginString;
}
}
Of course the line CUSTOM LOGIN CALLED
never gets printed... Should I check configuration somewhere?
Thanks in advance for any ideas!