Commits

Dannon Baker committed 4d7077d

Incorporation and slight update to pull request #43. The original contribution allowed access to file_path regardless of admin status and config setting.

  • Participants
  • Parent commits 81e6e2f

Comments (0)

Files changed (2)

lib/galaxy/model/__init__.py

                      deleted = hda.deleted,
                      visible = hda.visible,
                      state = hda.state,
-                     file_name = hda.file_name,
                      file_size = int( hda.get_size() ),
                      data_type = hda.ext,
                      genome_build = hda.dbkey,

lib/galaxy/web/api/history_contents.py

 """
 API operations on the contents of a history.
 """
-import logging, os, string, shutil, urllib, re, socket
-from cgi import escape, FieldStorage
-from galaxy import util, datatypes, jobs, web, util
+import logging
+from galaxy import web
 from galaxy.web.base.controller import *
-from galaxy.util.sanitize_html import sanitize_html
 from galaxy.model.orm import *
 
 import pkg_resources
             return str( e )
         try:
             item = content.get_api_value( view='element' )
+            if trans.user_is_admin() or trans.app.config.expose_dataset_path:
+                 item['file_name'] = hda.file_name
             if not item['deleted']:
                 # Problem: Method url_for cannot use the dataset controller
                 # Get the environment from DefaultWebTransaction and use default webapp mapper instead of webapp API mapper
         POST /api/libraries/{encoded_history_id}/contents
         Creates a new history content item (file, aka HistoryDatasetAssociation).
         """
-        params = util.Params( payload )
         from_ld_id = payload.get( 'from_ld_id', None )
 
         try: