{
try
{
String securityName =
rundata.getParameters().getString("security_name");
BaseSecurityEntry securityEntry =
(BaseSecurityEntry) Registry.getEntry(
Registry.SECURITY,
securityName);
if (securityEntry != null)
{
int[] accessIndexes =
rundata.getParameters().getInts("access_index");
if (accessIndexes != null && accessIndexes.length > 0)
{
ArrayList deleteList = new ArrayList();
for (int i = 0; i < accessIndexes.length; i++)
{
int accessIndex = accessIndexes[i];
accessIndex--;
if (accessIndex >= 0
&& accessIndex < securityEntry.getAccesses().size())
{
deleteList.add(
securityEntry.getAccesses().get(accessIndex));
}
else
{
logger.error(
"Access Index: " + i + " is out of range");
}
}
Vector accesses = securityEntry.getAccesses();
Iterator deleteIter = deleteList.iterator();
while (deleteIter.hasNext())
{
SecurityAccess sa = (SecurityAccess) deleteIter.next();
accesses.remove(sa);
}
securityEntry.setAccesses(accesses);
Registry.addEntry(Registry.SECURITY, securityEntry);
clearUserData(rundata);
}
else