mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 12:13:33 +08:00
Save a query per output during tool execution.
This commit is contained in:
@@ -89,7 +89,7 @@ class RBACAgent:
|
||||
def history_set_default_permissions( self, history, permissions=None, dataset=False, bypass_manage_permission=False ):
|
||||
raise "Unimplemented Method"
|
||||
|
||||
def set_all_dataset_permissions( self, dataset, permissions ):
|
||||
def set_all_dataset_permissions( self, dataset, permissions, new=False ):
|
||||
raise "Unimplemented Method"
|
||||
|
||||
def set_dataset_permission( self, dataset, permission ):
|
||||
@@ -871,7 +871,7 @@ class GalaxyRBACAgent( RBACAgent ):
|
||||
permissions[ action ] = [ dhp.role ]
|
||||
return permissions
|
||||
|
||||
def set_all_dataset_permissions( self, dataset, permissions={} ):
|
||||
def set_all_dataset_permissions( self, dataset, permissions={}, new=False ):
|
||||
"""
|
||||
Set new full permissions on a dataset, eliminating all current permissions.
|
||||
Permission looks like: { Action : [ Role, Role ] }
|
||||
@@ -890,9 +890,10 @@ class GalaxyRBACAgent( RBACAgent ):
|
||||
return "At least 1 role must be associated with the <b>manage permissions</b> permission on this dataset."
|
||||
flush_needed = False
|
||||
# Delete all of the current permissions on the dataset
|
||||
for dp in dataset.actions:
|
||||
self.sa_session.delete( dp )
|
||||
flush_needed = True
|
||||
if not new:
|
||||
for dp in dataset.actions:
|
||||
self.sa_session.delete( dp )
|
||||
flush_needed = True
|
||||
# Add the new permissions on the dataset
|
||||
for action, roles in permissions.items():
|
||||
if isinstance( action, Action ):
|
||||
|
||||
@@ -254,7 +254,7 @@ class DefaultToolAction( object ):
|
||||
# Commit the dataset immediately so it gets database assigned unique id
|
||||
trans.sa_session.add( data )
|
||||
trans.sa_session.flush()
|
||||
trans.app.security_agent.set_all_dataset_permissions( data.dataset, output_permissions )
|
||||
trans.app.security_agent.set_all_dataset_permissions( data.dataset, output_permissions, new=True )
|
||||
|
||||
object_store_populator.set_object_store_id( data )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user