code: public List<ActivityRecord> retrieveHistory(ModeledAuthenticatedUser authenticatedUser,
              ModeledUser user) throws GuacamoleException {
  
          String username = user.getIdentifier();
  
          // Retrieve history only if READ permission is granted
          if (hasObjectPermission(authenticatedUser, username, ObjectPermission.Type.READ))
              return getObjectInstances(userRecordMapper.select(username));
  
          // The user does not have permission to read the history
          throw new GuacamoleSecurityException("Permission denied.");
  
      }
docs: Retrieves the login history of the given user, including any active
  sessions.
  
  @param authenticatedUser
  The user retrieving the login history.
  
  @param user
  The user whose history is being retrieved.
  
  @return
  The login history of the given user, including any active sessions.
  
  @throws GuacamoleException
  If permission to read the login history is denied.