All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.resteasy.plugins.server.tjws.AuthenticatedHttpServletRequest Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package org.jboss.resteasy.plugins.server.tjws;

import org.jboss.resteasy.plugins.server.embedded.SecurityDomain;

import javax.servlet.http.HttpServletRequest;
import java.security.Principal;

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
class AuthenticatedHttpServletRequest extends PatchedHttpServletRequest
{
   private SecurityDomain domain;
   private Principal user;
   private String authType;

   public AuthenticatedHttpServletRequest(HttpServletRequest delegate, SecurityDomain domain, Principal user, String authType, String contextPath)
   {
      super(delegate, contextPath);
      this.domain = domain;
      this.user = user;
      this.authType = authType;
   }

   public boolean isUserInRole(String role)
   {
      return domain.isUserInRole(user, role);
   }

   public Principal getUserPrincipal()
   {
      return user;
   }

   @Override
   public String getAuthType()
   {
      return authType;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy