Methods Summary |
---|
public synchronized boolean | addEntry(java.security.Principal principal, AclEntry aclentry)
if(!isOwner(principal)) throw new NotOwnerException();
Hashtable hashtable = findTable(aclentry);
Principal principal1 = aclentry.getPrincipal();
if(hashtable.get(principal1) != null) {
return false;
} else {
hashtable.put(principal1, aclentry);
return true;
}
|
public boolean | checkPermission(java.security.Principal principal, Permission permission)
for(Enumeration enumeration = getPermissions(principal); enumeration.hasMoreElements();) {
Permission permission1 = (Permission)enumeration.nextElement();
if(permission1.equals(permission))
return true;
}
return false;
|
public synchronized java.util.Enumeration | entries()
return new AclEnumerator(this, allowedUsersTable, allowedGroupsTable, deniedUsersTable, deniedGroupsTable);
|
private java.util.Hashtable | findTable(AclEntry aclentry)
Hashtable hashtable = null;
Principal principal = aclentry.getPrincipal();
if(principal instanceof Group) {
if(aclentry.isNegative())
hashtable = deniedGroupsTable;
else
hashtable = allowedGroupsTable;
} else
if(aclentry.isNegative())
hashtable = deniedUsersTable;
else
hashtable = allowedUsersTable;
return hashtable;
|
private java.util.Enumeration | getGroupNegative(java.security.Principal principal)
Enumeration enumeration = zeroSet.elements();
Enumeration enumeration1 = deniedGroupsTable.keys();
do {
if(!enumeration1.hasMoreElements())
break;
Group group = (Group)enumeration1.nextElement();
if(group.isMember(principal)) {
AclEntry aclentry = (AclEntry)deniedGroupsTable.get(group);
enumeration = union(aclentry.permissions(), enumeration);
}
} while(true);
return enumeration;
|
private java.util.Enumeration | getGroupPositive(java.security.Principal principal)
Enumeration enumeration = zeroSet.elements();
Enumeration enumeration1 = allowedGroupsTable.keys();
do {
if(!enumeration1.hasMoreElements())
break;
Group group = (Group)enumeration1.nextElement();
if(group.isMember(principal)) {
AclEntry aclentry = (AclEntry)allowedGroupsTable.get(group);
enumeration = union(aclentry.permissions(), enumeration);
}
} while(true);
return enumeration;
|
private java.util.Enumeration | getIndividualNegative(java.security.Principal principal)
Enumeration enumeration = zeroSet.elements();
AclEntry aclentry = (AclEntry)deniedUsersTable.get(principal);
if(aclentry != null)
enumeration = aclentry.permissions();
return enumeration;
|
private java.util.Enumeration | getIndividualPositive(java.security.Principal principal)
Enumeration enumeration = zeroSet.elements();
AclEntry aclentry = (AclEntry)allowedUsersTable.get(principal);
if(aclentry != null)
enumeration = aclentry.permissions();
return enumeration;
|
public java.lang.String | getName()
return aclName;
|
public synchronized java.util.Enumeration | getPermissions(java.security.Principal principal)
Enumeration enumeration2 = subtract(getGroupPositive(principal), getGroupNegative(principal));
Enumeration enumeration3 = subtract(getGroupNegative(principal), getGroupPositive(principal));
Enumeration enumeration = subtract(getIndividualPositive(principal), getIndividualNegative(principal));
Enumeration enumeration1 = subtract(getIndividualNegative(principal), getIndividualPositive(principal));
Enumeration enumeration4 = subtract(enumeration2, enumeration1);
Enumeration enumeration5 = union(enumeration, enumeration4);
enumeration = subtract(getIndividualPositive(principal), getIndividualNegative(principal));
enumeration1 = subtract(getIndividualNegative(principal), getIndividualPositive(principal));
enumeration4 = subtract(enumeration3, enumeration);
Enumeration enumeration6 = union(enumeration1, enumeration4);
return subtract(enumeration5, enumeration6);
|
public synchronized boolean | removeEntry(java.security.Principal principal, AclEntry aclentry)
if(!isOwner(principal)) {
throw new NotOwnerException();
} else {
Hashtable hashtable = findTable(aclentry);
Principal principal1 = aclentry.getPrincipal();
Object obj = hashtable.remove(principal1);
return obj != null;
}
|
public void | setName(java.security.Principal principal, java.lang.String s)
if(!isOwner(principal)) {
throw new NotOwnerException();
} else {
aclName = s;
return;
}
|
private java.util.Enumeration | subtract(java.util.Enumeration enumeration, java.util.Enumeration enumeration1)
Vector vector = new Vector(20, 20);
for(; enumeration.hasMoreElements(); vector.addElement(enumeration.nextElement()));
do {
if(!enumeration1.hasMoreElements())
break;
Object obj = enumeration1.nextElement();
if(vector.contains(obj))
vector.removeElement(obj);
} while(true);
return vector.elements();
|
public java.lang.String | toString()
StringBuffer stringbuffer = new StringBuffer();
for(Enumeration enumeration = entries(); enumeration.hasMoreElements(); stringbuffer.append("\n")) {
AclEntry aclentry = (AclEntry)enumeration.nextElement();
stringbuffer.append(aclentry.toString().trim());
}
return stringbuffer.toString();
|
private static java.util.Enumeration | union(java.util.Enumeration enumeration, java.util.Enumeration enumeration1)
Vector vector = new Vector(20, 20);
for(; enumeration.hasMoreElements(); vector.addElement(enumeration.nextElement()));
do {
if(!enumeration1.hasMoreElements())
break;
Object obj = enumeration1.nextElement();
if(!vector.contains(obj))
vector.addElement(obj);
} while(true);
return vector.elements();
|