else
{
criteria.addEqualTo("id", permission.getId());
}
Query query = QueryFactory.newQuery(PersistentJetspeedPermissionImpl.class, criteria);
PersistentJetspeedPermission current = (PersistentJetspeedPermission)getPersistenceBrokerTemplate().getObjectByQuery(query);
if (current == null)
{
throw new SecurityException(SecurityException.PERMISSION_DOES_NOT_EXIST.create(permission.getName()));
}
if (!current.getActions().equals(permission.getActions()))
{
current.setActions(permission.getActions());
try
{
getPersistenceBrokerTemplate().store(current);
}
catch (Exception pbe)