1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/b3585fb0c986/ changeset: b3585fb0c986 user: smcmanus date: 2012-11-04 07:49:43 summary: The input datatype for display changed from LibraryDataset to Dataset, causing permission-checking issues. They've been fixed. affected #: 2 files diff -r c0f9edeb7ab137bf7adf76478eccb7fc32557cef -r b3585fb0c98639a57d8934f09f4553a3ad69e80b lib/galaxy/security/__init__.py --- a/lib/galaxy/security/__init__.py +++ b/lib/galaxy/security/__init__.py @@ -275,11 +275,12 @@ # then the returned permissions will not carry an entry for the dataset. ret_permissions = {} if ( len( permission_items ) > 0 ): + # SM: NB: LibraryDatasets became Datasets for some odd reason. if ( isinstance( permission_items[0], trans.model.LibraryDataset ) ): ids = [ item.library_dataset_id for item in permission_items ] permissions = trans.sa_session.query( trans.model.LibraryDatasetPermissions ) \ .filter( and_( trans.model.LibraryDatasetPermissions.library_dataset_id.in_( ids ), - trans.model.LibraryDatasetPermissions.action == action ) ) \ + trans.model.LibraryDatasetPermissions.action == action.action ) ) \ .all() # Massage the return data. We will return a list of permissions @@ -292,6 +293,23 @@ ret_permissions[ item.library_dataset_id ] = [] for permission in permissions: ret_permissions[ permission.library_dataset_id ].append( permission ) + elif ( isinstance( permission_items[0], trans.model.Dataset ) ): + ids = [ item.id for item in permission_items ] + permissions = trans.sa_session.query( trans.model.DatasetPermissions ) \ + .filter( and_( trans.model.DatasetPermissions.dataset_id.in_( ids ), + trans.model.DatasetPermissions.action == action.action ) ) \ + .all() + + # Massage the return data. We will return a list of permissions + # for each library dataset. So we initialize the return list to + # have an empty list for each dataset. Then each permission is + # appended to the right lib dataset. + # TODO: Consider eliminating the initialization and just return + # empty values for each library dataset id. + for item in permission_items: + ret_permissions[ item.id ] = [] + for permission in permissions: + ret_permissions[ permission.dataset_id ].append( permission ) # Test that we get the same response from get_item_actions each item: test_code = False @@ -333,14 +351,13 @@ LDDAs. """ all_items_actions = self.get_actions_for_items( trans, action, items ) + ret_allow_action = {} - ret_allow_action = {} # Change item to lib_dataset or vice-versa. for item in items: if all_items_actions.has_key( item.id ): item_actions = all_items_actions[ item.id ] - # For access, all of the dataset's if self.permitted_actions.DATASET_ACCESS == action: ret_allow_action[ item.id ] = True for item_action in item_actions: diff -r c0f9edeb7ab137bf7adf76478eccb7fc32557cef -r b3585fb0c98639a57d8934f09f4553a3ad69e80b lib/galaxy/webapps/galaxy/controllers/library_common.py --- a/lib/galaxy/webapps/galaxy/controllers/library_common.py +++ b/lib/galaxy/webapps/galaxy/controllers/library_common.py @@ -131,7 +131,17 @@ comptypes = get_comptypes( trans ) try: if self.app.config.new_lib_browse: - pass + return trans.fill_template( 'library/common/browse_library_opt.mako', + cntrller=cntrller, + use_panels=use_panels, + library=library, + created_ldda_ids=created_ldda_ids, + hidden_folder_ids=hidden_folder_ids, + show_deleted=show_deleted, + comptypes=comptypes, + current_user_roles=current_user_roles, + message=message, + status=status ) else: return trans.fill_template( 'library/common/browse_library.mako', cntrller=cntrller, 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.