com.caucho.server.security
Class RoleConstraint

java.lang.Object
  extended by com.caucho.server.security.AbstractConstraint
      extended by com.caucho.server.security.RoleConstraint

public class RoleConstraint
extends AbstractConstraint


Constructor Summary
RoleConstraint()
           
 
Method Summary
 void addRoleName(java.lang.String role)
           
 AuthorizationResult isAuthorized(HttpServletRequest request, HttpServletResponse response, ServletContext application)
          Returns true if the user is authorized for the resource.
 boolean needsAuthentication()
          Returns true if the constraint requires authentication.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.server.security.AbstractConstraint
isPrivateCache, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoleConstraint

public RoleConstraint()
Method Detail

addRoleName

public void addRoleName(java.lang.String role)

needsAuthentication

public boolean needsAuthentication()
Returns true if the constraint requires authentication.

Overrides:
needsAuthentication in class AbstractConstraint

isAuthorized

public AuthorizationResult isAuthorized(HttpServletRequest request,
                                        HttpServletResponse response,
                                        ServletContext application)
                                 throws ServletException,
                                        java.io.IOException
Returns true if the user is authorized for the resource.

Specified by:
isAuthorized in class AbstractConstraint
Parameters:
request - the servlet request
response - the servlet response
Returns:
true if the request is authorized.
Throws:
ServletException
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object