int deletable=0;
QueryResults results = oql.execute(Database.READONLY);
while (results.hasMore())
{
AccessRight accessRight = (AccessRight)results.next();
AccessRightVO accessRightVO = accessRight.getValueObject();
if(populateRelated)
{
AccessRight fullAccessRight = getAccessRightWithId(accessRightVO.getId(), db);
populateDescription(db, accessRightVO, fullAccessRight);
List<AccessRightRoleVO> roles = toVOList(fullAccessRight.getRoles());
List<AccessRightGroupVO> groups = toVOList(fullAccessRight.getGroups());
List<AccessRightUserVO> users = toVOList(fullAccessRight.getUsers());
accessRightVO.getRoles().addAll(roles);
accessRightVO.getGroups().addAll(groups);
accessRightVO.getUsers().addAll(users);
if(roles.size() == 0 && groups.size() == 0 && users.size() == 0)
{
duplicates.add(accessRightVO);
duplicatesEasyToDelete.add(accessRightVO);
}