commit/galaxy-central: John Duddy: Fix copy/paste errors in histry contents API
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/fa97a5c307d2/ changeset: fa97a5c307d2 user: John Duddy date: 2011-10-31 21:13:12 summary: Fix copy/paste errors in histry contents API affected #: 2 files diff -r 22d844537368bff2acb8eb50bce6561a673002ef -r fa97a5c307d228cd53673eca55fce0c9f12cfe4e lib/galaxy/web/api/history_contents.py --- a/lib/galaxy/web/api/history_contents.py +++ b/lib/galaxy/web/api/history_contents.py @@ -50,7 +50,9 @@ """ content_id = id try: - content = self.get_history_dataset_association( trans, content_id, check_ownership=True, check_accessible=True ) + # get the history just for the access checks + history = self.get_history( trans, history_id, check_ownership=True, check_accessible=True, deleted=False ) + content = self.get_history_dataset_association( trans, history, content_id, check_ownership=True, check_accessible=True ) except Exception, e: return str( e ) try: diff -r 22d844537368bff2acb8eb50bce6561a673002ef -r fa97a5c307d228cd53673eca55fce0c9f12cfe4e lib/galaxy/web/base/controller.py --- a/lib/galaxy/web/base/controller.py +++ b/lib/galaxy/web/base/controller.py @@ -233,16 +233,18 @@ else: error( "You are not allowed to access this dataset" ) return data - def get_history_dataset_association( self, trans, dataset_id, check_ownership=True, check_accessible=False ): + def get_history_dataset_association( self, trans, history, dataset_id, check_ownership=True, check_accessible=False ): """Get a HistoryDatasetAssociation from the database by id, verifying ownership.""" - hda = self.get_object( trans, id, 'HistoryDatasetAssociation', check_ownership=check_ownership, check_accessible=check_accessible, deleted=deleted ) - self.security_check( trans, history, check_ownership=check_ownership, check_accessible=False ) # check accessibility here + self.security_check( trans, history, check_ownership=check_ownership, check_accessible=check_accessible ) + hda = self.get_object( trans, dataset_id, 'HistoryDatasetAssociation', check_ownership=False, check_accessible=False, deleted=False ) + if check_accessible: if trans.app.security_agent.can_access_dataset( trans.get_current_user_roles(), hda.dataset ): if hda.state == trans.model.Dataset.states.UPLOAD: error( "Please wait until this dataset finishes uploading before attempting to view it." ) else: error( "You are not allowed to access this dataset" ) + return hda def get_data( self, dataset, preview=True ): """ Gets a dataset's data. """ # Get data from file, truncating if necessary. Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket