// checks to see if the Authentication object principal is the owner of the supplied widgetRating object
// if trustedDomainObject is false, pull the entity from the database first to ensure
// the model object is trusted and hasn't been modified
private boolean isWidgetRatingOwner(Authentication authentication, WidgetRating widgetRating, List<WidgetRating> trustedWidgetRatingContainer, boolean trustedDomainObject) {
WidgetRating trustedWidgetRating = null;
if (trustedDomainObject) {
trustedWidgetRating = widgetRating;
} else {
trustedWidgetRating = getTrustedWidgetRating(widgetRating.getId(), trustedWidgetRatingContainer);
}
return isWidgetRatingOwnerById(authentication, trustedWidgetRating.getUserId());
}