/*
- * $Header: /cvsroot/securityfilter/securityfilter/src/share/org/securityfilter/realm/SimpleSecurityRealmBase.java,v 1.3 2002/08/17 14:11:55 maxcooper Exp $
- * $Revision: 1.3 $
- * $Date: 2002/08/17 14:11:55 $
+ * $Header: /cvsroot/securityfilter/securityfilter/src/share/org/securityfilter/realm/SimpleSecurityRealmBase.java,v 1.4 2002/08/19 17:11:36 maxcooper Exp $
+ * $Revision: 1.4 $
+ * $Date: 2002/08/19 17:11:36 $
*
* ====================================================================
* The SecurityFilter Software License, Version 1.1
* a Principal object and this class does the conversions for you.
*
* @author Max Cooper (max@maxcooper.com)
- * @version $Revision: 1.3 $ $Date: 2002/08/17 14:11:55 $
+ * @version $Revision: 1.4 $ $Date: 2002/08/19 17:11:36 $
*/
public class SimpleSecurityRealmBase implements SecurityRealmInterface {
* @return true if the user is in the role, false otherwise
*/
public boolean isUserInRole(Principal principal, String rolename) {
- return isUserInRole(principal.getName(), rolename);
+ String username = null;
+ if (principal != null) {
+ username = principal.getName();
+ }
+ return isUserInRole(username, rolename);
}
}