mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fixes for accessing libraries from the analysis view.
This commit is contained in:
@@ -7,7 +7,8 @@ log = logging.getLogger( __name__ )
|
||||
class Library( BaseController ):
|
||||
@web.expose
|
||||
def browse( self, trans, **kwd ):
|
||||
return trans.fill_template( '/library/browser.mako', libraries=trans.app.model.Library.filter_by( deleted=False ).all() )
|
||||
libraries=trans.app.model.Library.filter_by( deleted=False ).order_by( trans.app.model.Library.table.c.name ).all()
|
||||
return trans.fill_template( '/library/browser.mako', libraries=libraries )
|
||||
index = browse
|
||||
@web.expose
|
||||
def import_datasets( self, trans, import_ids=[], **kwd ):
|
||||
|
||||
@@ -64,10 +64,10 @@ def require_admin( func ):
|
||||
def decorator( self, trans, *args, **kwargs ):
|
||||
admin_users = trans.app.config.get( "admin_users", "" ).split( "," )
|
||||
if not admin_users:
|
||||
return trans.show_error_message( "You must be an administrator to access this feature, and no administrators are set in the Galaxy configuration." )
|
||||
return trans.show_error_message( "You must be logged in as an administrator to access this feature, but no administrators are set in the Galaxy configuration." )
|
||||
user = trans.get_user()
|
||||
if not user:
|
||||
return trans.show_error_message( "You must be an administrator to access this feature, and currently you are not logged in." )
|
||||
return trans.show_error_message( "You must be logged in as an administrator to access this feature." )
|
||||
if not user.email in admin_users:
|
||||
return trans.show_error_message( "You must be an administrator to access this feature." )
|
||||
return func( self, trans, *args, **kwargs )
|
||||
@@ -264,6 +264,7 @@ class UniverseWebTransaction( base.DefaultWebTransaction ):
|
||||
url_for( controller='user', action='login' ),
|
||||
url_for( controller='user', action='create' ),
|
||||
url_for( controller='user', action='reset_password' ),
|
||||
url_for( controller='library', action='browse' )
|
||||
)
|
||||
if self.galaxy_session.user is None and environ['PATH_INFO'] not in allowed_paths:
|
||||
self.response.send_redirect( url_for( controller='root', action='index' ) )
|
||||
|
||||
@@ -2,7 +2,7 @@ import galaxy.model
|
||||
from galaxy.model.orm import *
|
||||
from base.twilltestcase import *
|
||||
|
||||
not_logged_in_security_msg = 'You must be an administrator to access this feature, and currently you are not logged in.'
|
||||
not_logged_in_security_msg = 'You must be logged in as an administrator to access this feature.'
|
||||
logged_in_security_msg = 'You must be an administrator to access this feature.'
|
||||
|
||||
class TestHistory( TwillTestCase ):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<tool name="Access Libraries" id="library_access1">
|
||||
<description>stored locally</description>
|
||||
<inputs action="library/browse" method="get">
|
||||
<param name="bogus_param" type="hidden" value="needed" />
|
||||
</inputs>
|
||||
<description>stored locally</description>
|
||||
<inputs action="/library/browse" method="get">
|
||||
<param name="bogus_param" type="hidden" value="needed" />
|
||||
</inputs>
|
||||
</tool>
|
||||
|
||||
Reference in New Issue
Block a user