コード例 #1
0
ファイル: BaseAsyncDAO.java プロジェクト: osarrat/sigmah
  /**
   * Retrieves the current authentication.
   *
   * @return The current authentication.
   */
  public Authentication getAuthentication() {
    final Authentication authentication = authenticationProvider.get();

    if (authentication.getUserEmail() == null) {
      // Search the last logged user in the users database
      final Storage storage = Storage.getLocalStorageIfSupported();
      final String email = storage.getItem(LocalDispatchServiceAsync.LAST_USER_ITEM);

      authentication.setUserEmail(email);
    }

    return authentication;
  }
コード例 #2
0
ファイル: BaseAsyncDAO.java プロジェクト: osarrat/sigmah
 /**
  * Returns <code>true</code> if the current user is anonymous.
  *
  * @return <code>true</code> if the current user is anonymous, <code>false</code> otherwise.
  */
 public boolean isAnonymous() {
   return authenticationProvider.isAnonymous();
 }