public List<HLocale> getTranslationLocale(String projectSlug, String iterationSlug) { if (authenticatedAccount == null) { return Collections.emptyList(); } return localeServiceImpl.getTranslation( projectSlug, iterationSlug, authenticatedAccount.getUsername()); }
/** * Utility method to get the authenticated account username. This differs from * org.jboss.seam.security.Credentials.getUsername() in that this returns the actual account's * username, not the user provided one (which for some authentication systems is non-existent). * * @return The currently authenticated account username, or null if the session is not * authenticated. */ @Nullable public String getAccountUsername() { HAccount authenticatedAccount = ServiceLocator.instance().getInstance(HAccount.class, new AuthenticatedLiteral()); if (authenticatedAccount != null) { return authenticatedAccount.getUsername(); } return null; }