public boolean isPhotoOwner(Photo photo) { boolean result = false; Client client = getClient(); if ((photo != null) && (client instanceof User)) { User user = (User) client; result = photo.getOwnerName().equals(user.getName()); } return result; }
/** Returns some signifier of current user */ public String getClientName() { String result = "anon"; if (!StringUtil.isNullOrEmptyString(getEmailAddressAsString())) { result = getEmailAddressAsString(); if (client instanceof User) { User user = (User) client; result = user.getName(); } } return result; }