[galaxy-commits] galaxy-dist commit 9289b4d7fa4d: API: Patch from Brad Chapman to prevent deleted items from appearing in library contents listing.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Jul 16 10:06:16 EDT 2010


# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Nate Coraor <nate at bx.psu.edu>
# Date 1277904834 14400
# Node ID 9289b4d7fa4d1d1b630c044dfbc102cf870f62e3
# Parent  1d05df35ec27cc606ddc486c83ea090e01a441d8
API: Patch from Brad Chapman to prevent deleted items from appearing in library contents listing.

--- a/lib/galaxy/web/api/contents.py
+++ b/lib/galaxy/web/api/contents.py
@@ -26,7 +26,7 @@ class ContentsController( BaseController
             for subfolder in folder.active_folders:
                 if not admin:
                     can_access, folder_ids = trans.app.security_agent.check_folder_contents( trans.user, current_user_roles, subfolder )
-                if admin or can_access:
+                if (admin or can_access) and not subfolder.deleted:
                     subfolder.api_path = folder.api_path + '/' + subfolder.name
                     subfolder.api_type = 'folder'
                     rval.append( subfolder )
@@ -34,7 +34,7 @@ class ContentsController( BaseController
             for ld in folder.datasets:
                 if not admin:
                     can_access = trans.app.security_agent.can_access_dataset( current_user_roles, ld.library_dataset_dataset_association.dataset )
-                if admin or can_access:
+                if (admin or can_access) and not ld.deleted:
                     ld.api_path = folder.api_path + '/' + ld.name
                     ld.api_type = 'file'
                     rval.append( ld )


More information about the galaxy-commits mailing list