code: private List<Alert> _getAlertsByOwner(String alertname, PrincipalUser owner, boolean populateMetaFieldsOnly) {
  		List<Alert> result;
  		if (alertname != null && !alertname.isEmpty()) {
  			result = new ArrayList<>();
  			Alert alert = alertService.findAlertByNameAndOwner(alertname, owner);
  			if (alert != null) {
  				result.add(alert);
  			} else {
  				throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND);
  			}
  		} else {
  			if(owner.isPrivileged()) {
  				result = populateMetaFieldsOnly ? alertService.findAllAlerts(true) : alertService.findAllAlerts(false);
  			} else {
  				result = populateMetaFieldsOnly ? alertService.findAlertsByOwner(owner, true): alertService.findAlertsByOwner(owner, false);
  			}
  		}
  		return result;
  	}
docs: Return all alerts in alert objects filtered by owner.
  @param   alertname  	                  The alert name filter.
  @param   owner                         The principlaUser owner for owner name filter.
  @param   populateMetaFieldsOnly        Flag to populate alert meta field only.
  
  @return  The list of filtered alerts in alert object.