commit/galaxy-central: greg: Fix grid operations for use in UserListGrid to allow for Delete, Undelete, Purge of users if the allow_user_deletion config setting is true.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/26da65326612/ changeset: 26da65326612 user: greg date: 2011-11-11 01:23:44 summary: Fix grid operations for use in UserListGrid to allow for Delete, Undelete, Purge of users if the allow_user_deletion config setting is true. affected #: 5 files diff -r 52bf302e209ed6890e37fa49215d8875af7ab1f1 -r 26da65326612232bfc7a0a9beddaeb176c9974ae lib/galaxy/web/base/controller.py --- a/lib/galaxy/web/base/controller.py +++ b/lib/galaxy/web/base/controller.py @@ -19,7 +19,6 @@ from Cheetah.Template import Template - pkg_resources.require( 'elementtree' ) from elementtree import ElementTree, ElementInclude from elementtree.ElementTree import Element @@ -1298,6 +1297,9 @@ group_list_grid = None quota_list_grid = None repository_list_grid = None + delete_operation = None + undelete_operation = None + purge_operation = None @web.expose @web.require_admin @@ -2217,6 +2219,13 @@ **kwd ) ) elif operation == "manage roles and groups": return self.manage_roles_and_groups_for_user( trans, **kwd ) + if trans.app.config.allow_user_deletion: + if self.delete_operation not in self.user_list_grid.operations: + self.user_list_grid.operations.append( self.delete_operation ) + if self.undelete_operation not in self.user_list_grid.operations: + self.user_list_grid.operations.append( self.undelete_operation ) + if self.purge_operation not in self.user_list_grid.operations: + self.user_list_grid.operations.append( self.purge_operation ) # Render the list view return self.user_list_grid( trans, **kwd ) @web.expose diff -r 52bf302e209ed6890e37fa49215d8875af7ab1f1 -r 26da65326612232bfc7a0a9beddaeb176c9974ae lib/galaxy/web/controllers/admin.py --- a/lib/galaxy/web/controllers/admin.py +++ b/lib/galaxy/web/controllers/admin.py @@ -93,11 +93,6 @@ allow_popup=False, url_args=dict( webapp="galaxy", action="reset_user_password" ) ) ] - #TODO: enhance to account for trans.app.config.allow_user_deletion here so that we can eliminate these operations if - # the setting is False - #operations.append( grids.GridOperation( "Delete", condition=( lambda item: not item.deleted ), allow_multiple=True ) ) - #operations.append( grids.GridOperation( "Undelete", condition=( lambda item: item.deleted and not item.purged ), allow_multiple=True ) ) - #operations.append( grids.GridOperation( "Purge", condition=( lambda item: item.deleted and not item.purged ), allow_multiple=True ) ) standard_filters = [ grids.GridColumnFilter( "Active", args=dict( deleted=False ) ), grids.GridColumnFilter( "Deleted", args=dict( deleted=True, purged=False ) ), @@ -443,6 +438,9 @@ group_list_grid = GroupListGrid() quota_list_grid = QuotaListGrid() repository_list_grid = RepositoryListGrid() + delete_operation = grids.GridOperation( "Delete", condition=( lambda item: not item.deleted ), allow_multiple=True ) + undelete_operation = grids.GridOperation( "Undelete", condition=( lambda item: item.deleted and not item.purged ), allow_multiple=True ) + purge_operation = grids.GridOperation( "Purge", condition=( lambda item: item.deleted and not item.purged ), allow_multiple=True ) @web.expose @web.require_admin diff -r 52bf302e209ed6890e37fa49215d8875af7ab1f1 -r 26da65326612232bfc7a0a9beddaeb176c9974ae lib/galaxy/webapps/community/config.py --- a/lib/galaxy/webapps/community/config.py +++ b/lib/galaxy/webapps/community/config.py @@ -61,6 +61,7 @@ self.remote_user_logout_href = kwargs.get( "remote_user_logout_href", None ) self.require_login = string_as_bool( kwargs.get( "require_login", "False" ) ) self.allow_user_creation = string_as_bool( kwargs.get( "allow_user_creation", "True" ) ) + self.allow_user_deletion = string_as_bool( kwargs.get( "allow_user_deletion", "False" ) ) self.enable_openid = string_as_bool( kwargs.get( 'enable_openid', False ) ) self.template_path = resolve_path( kwargs.get( "template_path", "templates" ), self.root ) self.template_cache = resolve_path( kwargs.get( "template_cache_path", "database/compiled_templates/community" ), self.root ) diff -r 52bf302e209ed6890e37fa49215d8875af7ab1f1 -r 26da65326612232bfc7a0a9beddaeb176c9974ae lib/galaxy/webapps/demo_sequencer/config.py --- a/lib/galaxy/webapps/demo_sequencer/config.py +++ b/lib/galaxy/webapps/demo_sequencer/config.py @@ -40,6 +40,7 @@ self.remote_user_logout_href = kwargs.get( "remote_user_logout_href", None ) self.require_login = string_as_bool( kwargs.get( "require_login", "False" ) ) self.allow_user_creation = string_as_bool( kwargs.get( "allow_user_creation", "True" ) ) + self.allow_user_deletion = string_as_bool( kwargs.get( "allow_user_deletion", "False" ) ) self.template_path = resolve_path( kwargs.get( "template_path", "templates" ), self.root ) self.template_cache = resolve_path( kwargs.get( "template_cache_path", "database/compiled_templates/demo_sequencer" ), self.root ) self.admin_users = kwargs.get( "admin_users", "" ) diff -r 52bf302e209ed6890e37fa49215d8875af7ab1f1 -r 26da65326612232bfc7a0a9beddaeb176c9974ae lib/galaxy/webapps/reports/config.py --- a/lib/galaxy/webapps/reports/config.py +++ b/lib/galaxy/webapps/reports/config.py @@ -31,6 +31,8 @@ self.template_path = resolve_path( kwargs.get( "template_path", "templates" ), self.root ) self.template_cache = resolve_path( kwargs.get( "template_cache_path", "database/compiled_templates/reports" ), self.root ) self.sendmail_path = kwargs.get('sendmail_path',"/usr/sbin/sendmail") + self.allow_user_creation = string_as_bool( kwargs.get( "allow_user_creation", "True" ) ) + self.allow_user_deletion = string_as_bool( kwargs.get( "allow_user_deletion", "False" ) ) self.log_actions = string_as_bool( kwargs.get( 'log_actions', 'False' ) ) self.brand = kwargs.get( 'brand', None ) self.wiki_url = kwargs.get( 'wiki_url', 'http://wiki.g2.bx.psu.edu/FrontPage' ) 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