FileDocCategorySizeDatePackage
MemorySecurityRealm.javaAPI DocExample742Wed Sep 08 09:49:38 BST 2004com.oreilly.strutsckbk.ch11.sf

MemorySecurityRealm

public class MemorySecurityRealm extends org.securityfilter.realm.SimpleSecurityRealmBase

Fields Summary
private SecurityService
serviceImpl
Constructors Summary
Methods Summary
public booleanbooleanAuthenticate(java.lang.String username, java.lang.String password)


         
       try {
           User user = serviceImpl.authenticate(username, password);
           if (user != null) return true;
       } catch (SecurityException e) {
           e.printStackTrace();
       }
       return false;
   
public booleanisUserInRole(java.lang.String username, java.lang.String role)

       User user = serviceImpl.findUser(username);
       return user == null ? false : user.hasRole(role);