--- java/classes/org/w3c/jigsaw/acl/AclRealm.java 1999/04/27 15:05:47 1.8 +++ java/classes/org/w3c/jigsaw/acl/AclRealm.java 2000/06/23 14:29:23 1.8.4.1 @@ -1,5 +1,5 @@ // AclRealm.java -// $Id: AclRealm.java,v 1.8 1999/04/27 15:05:47 bmahe Exp $ +// $Id: AclRealm.java,v 1.8.4.1 2000/06/23 14:29:23 ylafon Exp $ // (c) COPYRIGHT MIT, INRIA and Keio, 1999. // Please first read the full copyright statement in file COPYRIGHT.html @@ -15,8 +15,10 @@ import java.util.Vector; import org.w3c.jigsaw.auth.AuthRealm; import org.w3c.jigsaw.auth.AuthUser; +import org.w3c.jigsaw.auth.AuthFilter; import org.w3c.jigsaw.auth.IPMatcher; import org.w3c.jigsaw.auth.RealmsCatalog; +import org.w3c.jigsaw.http.Request; import org.w3c.jigsaw.http.httpd; import org.w3c.tools.resources.FramedResource; @@ -28,7 +30,7 @@ import org.w3c.tools.resources.StringAtt import org.w3c.tools.resources.StringArrayAttribute; /** - * @version $Revision: 1.8 $ + * @version $Revision: 1.8.4.1 $ * @author Benoît Mahé (bmahe@w3.org) */ public class AclRealm extends JAcl { @@ -248,7 +250,23 @@ public class AclRealm extends JAcl { } if (! methodprotected) return true; - return hasPrincipal(principal); + boolean granted = hasPrincipal(principal); + if (granted) { + // let's add the username there + String username = principal.getName(); + if (username != null) { + try { + HTTPPrincipal htp = (HTTPPrincipal)principal; + Request request = htp.getRequest(); + if (username != null) { + request.setState(AuthFilter.STATE_AUTHUSER, username); + } + } catch (Exception ex) { + // was not an HTTPPrincipal + } + } + } + return granted; } public String toString() {