1 package net.sf.cantina.system; 2 3 import net.sf.cantina.User; 4 5 import javax.servlet.http.HttpServletRequest; 6 7 /*** 8 * @author Stephane JAIS 9 */ 10 public class HttpUser 11 implements User 12 { 13 HttpServletRequest r; 14 public HttpUser(HttpServletRequest r) 15 { 16 this.r = r; 17 } 18 19 public boolean isUserInRole(String role) 20 { 21 return r.isUserInRole(role); 22 } 23 24 public String getName() 25 { 26 return r.getUserPrincipal().getName(); 27 } 28 }