version 1.13, 2012/06/26 09:47:22
|
version 1.14, 2013/02/01 13:00:57
|
Line 10 import java.security.acl.AclEntry;
|
Line 10 import java.security.acl.AclEntry;
|
import java.security.acl.LastOwnerException; |
import java.security.acl.LastOwnerException; |
import java.security.acl.NotOwnerException; |
import java.security.acl.NotOwnerException; |
import java.security.acl.Permission; |
import java.security.acl.Permission; |
|
import java.util.ArrayList; |
import java.util.Enumeration; |
import java.util.Enumeration; |
import java.util.Vector; |
|
import org.w3c.jigsaw.auth.AuthFilter; |
import org.w3c.jigsaw.auth.AuthFilter; |
import org.w3c.jigsaw.auth.AuthRealm; |
import org.w3c.jigsaw.auth.AuthRealm; |
import org.w3c.jigsaw.auth.AuthUser; |
import org.w3c.jigsaw.auth.AuthUser; |
Line 87 public class AclRealm extends JAcl {
|
Line 87 public class AclRealm extends JAcl {
|
*/ |
*/ |
protected String loaded_realm = null; |
protected String loaded_realm = null; |
|
|
protected Vector entries = null; |
protected ArrayList<Principal> entries = null; |
|
|
/** |
/** |
* Get the list of methods that this filter protect |
* Get the list of methods that this filter protect |
Line 118 public class AclRealm extends JAcl {
|
Line 118 public class AclRealm extends JAcl {
|
* Get a pointer to our realm, and initialize our ipmatcher. |
* Get a pointer to our realm, and initialize our ipmatcher. |
*/ |
*/ |
protected synchronized void acquireRealm() { |
protected synchronized void acquireRealm() { |
entries = new Vector(10); |
entries = new ArrayList<Principal>(10); |
// Get our catalog: |
// Get our catalog: |
if (catalog == null) { |
if (catalog == null) { |
httpd server = (httpd) getTargetResource().getServer(); |
httpd server = (httpd) getTargetResource().getServer(); |
Line 179 public class AclRealm extends JAcl {
|
Line 179 public class AclRealm extends JAcl {
|
|
|
protected void createEntry(AuthUser user) { |
protected void createEntry(AuthUser user) { |
if (checkUser(user)) |
if (checkUser(user)) |
entries.addElement(new AuthUserPrincipal(user, getName())); |
entries.add(new AuthUserPrincipal(user, getName())); |
} |
} |
|
|
protected boolean hasPrincipal(Principal p) { |
protected boolean hasPrincipal(Principal p) { |
//test with equals... |
//test with equals... |
int idx = entries.indexOf(p); |
return entries.contains(p); |
return (idx != -1); |
|
} |
} |
|
|
public boolean addOwner(Principal caller, Principal owner) |
public boolean addOwner(Principal caller, Principal owner) |