au.com.lastweekend.htaccess
Class AccessControls

java.lang.Object
  extended by au.com.lastweekend.htaccess.AccessControls

public class AccessControls
extends java.lang.Object

Represents the user and ip based controls available in Apache mod_access/mod_auth (.htaccess)

Version:
$Id: AccessControls.java 100 2008-02-19 10:37:27Z lwoggardner $
Author:
Grant Gardner grant@lastweekend.com.au

Constructor Summary
AccessControls()
           
 
Method Summary
 boolean checkAccess(java.lang.String host, java.lang.String ip)
          Check if the supplied hostname and ip has the required level of access
 boolean checkUser(java.lang.String user, java.util.Set<java.lang.String> groups)
          Check if a user has the required level of access.
 boolean isAccessLimited()
           
 boolean isAuthLimited()
           
 boolean isSatisfyAll()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AccessControls

public AccessControls()
Method Detail

checkUser

public boolean checkUser(java.lang.String user,
                         java.util.Set<java.lang.String> groups)
Check if a user has the required level of access. Note that this does not authenticate the user.

Parameters:
user - An authenticated user
groups - The set of group names this user belongs to.
Returns:
true is the user has the required access

checkAccess

public boolean checkAccess(java.lang.String host,
                           java.lang.String ip)
Check if the supplied hostname and ip has the required level of access

Parameters:
host - Host name corresponding to the IP Address. if not supplied, blank or itself looks like an IP address, a host name lookup will be performed
ip - String representation of an IP address
Returns:
true if access is allowed

isAccessLimited

public boolean isAccessLimited()
Returns:
true if this access control limits by IP or host name.

isAuthLimited

public boolean isAuthLimited()
Returns:
true if this access control limits access by user/group

isSatisfyAll

public boolean isSatisfyAll()
Returns:
true if both IP and User access are required to be checked.

toString

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


Copyright © 2008. All Rights Reserved.