Dear All, Is it possible to delete a galaxy user or multiple users with a UI call or an API call? Thanks, Oren
On Nov 9, 2011, at 6:14 PM, Oren Livne wrote:
Dear All, Is it possible to delete a galaxy user or multiple users with a UI call or an API call?
Hi Oren, Deleting users via the API is not currently implemented, but it can be done under the admin panel in the UI. Adding it to the API would likely be fairly trivial. --nate
Thanks, Oren ___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
Dear Nate, Thanks for your answer. 1. I could not find it in the admin panel in the UI. When I click on "Manage users", I get the user list and can select users, but there is no "Delete User" button. 2. Which call in the code deletes a user? I can then write my own API method. 3. If I try to reset passwords for more than one user at a time, I get the error trackback: |TypeError: Odd-length string| URL: http://128.135.107.157:8080/admin/reset_user_password Module weberror.evalexception.middleware:*364* in |respond| <http://128.135.107.157:8080/admin/reset_user_password#> view <http://128.135.107.157:8080/admin/reset_user_password#> |>> <http://128.135.107.157:8080/admin/reset_user_password#>app_iter *=* self*.*application*(*environ*,* detect_start_response*)*| Module paste.debug.prints:*98* in |__call__| <http://128.135.107.157:8080/admin/reset_user_password#> view <http://128.135.107.157:8080/admin/reset_user_password#> |>> <http://128.135.107.157:8080/admin/reset_user_password#>environ*,* self*.*app*)*| Module paste.wsgilib:*539* in |intercept_output| <http://128.135.107.157:8080/admin/reset_user_password#> view <http://128.135.107.157:8080/admin/reset_user_password#> |>> <http://128.135.107.157:8080/admin/reset_user_password#>app_iter *=* application*(*environ*,* replacement_start_response*)*| Module paste.recursive:*80* in |__call__| <http://128.135.107.157:8080/admin/reset_user_password#> view <http://128.135.107.157:8080/admin/reset_user_password#> |>> <http://128.135.107.157:8080/admin/reset_user_password#>*return* self*.*application*(*environ*,* start_response*)*| Module paste.httpexceptions:*632* in |__call__| <http://128.135.107.157:8080/admin/reset_user_password#> view <http://128.135.107.157:8080/admin/reset_user_password#> |>> <http://128.135.107.157:8080/admin/reset_user_password#>*return* self*.*application*(*environ*,* start_response*)*| Module galaxy.web.framework.base:*160* in |__call__| <http://128.135.107.157:8080/admin/reset_user_password#> view <http://128.135.107.157:8080/admin/reset_user_password#> |>> <http://128.135.107.157:8080/admin/reset_user_password#>body *=* method*(* trans*,* ****kwargs *)*| Module galaxy.web.framework:*173* in |decorator| <http://128.135.107.157:8080/admin/reset_user_password#> view <http://128.135.107.157:8080/admin/reset_user_password#> |>> <http://128.135.107.157:8080/admin/reset_user_password#>*return* func*(* self*,* trans*,* ***args*,* ****kwargs *)*| Module galaxy.web.base.controller:*2025* in |reset_user_password| <http://128.135.107.157:8080/admin/reset_user_password#> view <http://128.135.107.157:8080/admin/reset_user_password#> |>> <http://128.135.107.157:8080/admin/reset_user_password#>user *=* get_user*(* trans*,* user_id *)*| Module galaxy.web.base.controller:*2413* in |get_user| <http://128.135.107.157:8080/admin/reset_user_password#> view <http://128.135.107.157:8080/admin/reset_user_password#> |>> <http://128.135.107.157:8080/admin/reset_user_password#>id *=* trans*.*security*.*decode_id*(* id *)*| Module galaxy.web.security:*45* in |decode_id| <http://128.135.107.157:8080/admin/reset_user_password#> view <http://128.135.107.157:8080/admin/reset_user_password#> |>> <http://128.135.107.157:8080/admin/reset_user_password#>*return* int*(* self*.*id_cipher*.*decrypt*(* obj_id*.*decode*(* 'hex' *)* *)**.*lstrip*(* "!" *)* *)*| Module encodings.hex_codec:*42* in |hex_decode| <http://128.135.107.157:8080/admin/reset_user_password#> view <http://128.135.107.157:8080/admin/reset_user_password#> |>> <http://128.135.107.157:8080/admin/reset_user_password#>output *=* binascii*.*a2b_hex*(*input*)*| *TypeError: Odd-length string* 4. A similar problem occurs when I try to delete multiple data libraries under "Manage data libraries". One library deletion works, but multiple yields an error message: Invalid Library id ( df7a1f0c02a5b08e,0a248a1f62a0cc04,03501d7626bd192f,3f5830403180d620,2a56795cad3c7db3,417e33144b294c21,5a1cff6882ddb5b2,2d9035b3fc152403,4b187121143038ff,c9468fdb6dc5c5f1,1e8ab44153008be8,e85a3be143d5905b ) specifield. Thanks so much in advance, Oren On 11/10/2011 10:36 AM, Nate Coraor wrote:
On Nov 9, 2011, at 6:14 PM, Oren Livne wrote:
Dear All, Is it possible to delete a galaxy user or multiple users with a UI call or an API call? Hi Oren,
Deleting users via the API is not currently implemented, but it can be done under the admin panel in the UI. Adding it to the API would likely be fairly trivial.
--nate
Thanks, Oren ___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
On Nov 10, 2011, at 11:41 AM, Oren Livne wrote:
Dear Nate,
Thanks for your answer.
1. I could not find it in the admin panel in the UI. When I click on "Manage users", I get the user list and can select users, but there is no "Delete User" button.
Hi Oren, Hrm, it looks like the option to delete users was removed from the interface since it couldn't be made conditional on a configuration setting (due to a limitation in Galaxy's "Grids" feature, which is used to display the table of users in the UI). They can be added by uncommented lines 98-100 in lib/galaxy/web/controllers/admin.py: #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 ) )
2. Which call in the code deletes a user? I can then write my own API method.
mark_user_deleted() in lib/galaxy/web/base/controller.py. The preferred method for implementing API methods is by moving the code in the web UI controller which performs the actual action to lib/galaxy/actions/ and then changing the API and UI methods to call that method. See the implementation of the Quota API for a reference.
3. If I try to reset passwords for more than one user at a time, I get the error trackback:
TypeError: Odd-length string URL: http://128.135.107.157:8080/admin/reset_user_password Module weberror.evalexception.middleware:364 in respond <plus.jpg> view
app_iter = self.application(environ, detect_start_response) Module paste.debug.prints:98 in __call__ <plus.jpg> view environ, self.app) Module paste.wsgilib:539 in intercept_output <plus.jpg> view app_iter = application(environ, replacement_start_response) Module paste.recursive:80 in __call__ <plus.jpg> view return self.application(environ, start_response) Module paste.httpexceptions:632 in __call__ <plus.jpg> view return self.application(environ, start_response) Module galaxy.web.framework.base:160 in __call__ <plus.jpg> view body = method( trans, **kwargs ) Module galaxy.web.framework:173 in decorator <plus.jpg> view return func( self, trans, *args, **kwargs ) Module galaxy.web.base.controller:2025 in reset_user_password <plus.jpg> view user = get_user( trans, user_id ) Module galaxy.web.base.controller:2413 in get_user <plus.jpg> view id = trans.security.decode_id( id ) Module galaxy.web.security:45 in decode_id <plus.jpg> view return int( self.id_cipher.decrypt( obj_id.decode( 'hex' ) ).lstrip( "!" ) ) Module encodings.hex_codec:42 in hex_decode <plus.jpg> view output = binascii.a2b_hex(input) TypeError: Odd-length string
4. A similar problem occurs when I try to delete multiple data libraries under "Manage data libraries". One library deletion works, but multiple yields an error message:
Invalid Library id ( df7a1f0c02a5b08e,0a248a1f62a0cc04,03501d7626bd192f,3f5830403180d620,2a56795cad3c7db3,417e33144b294c21,5a1cff6882ddb5b2,2d9035b3fc152403,4b187121143038ff,c9468fdb6dc5c5f1,1e8ab44153008be8,e85a3be143d5905b ) specifield.
Thanks for reporting these, we'll fix them as soon as possible. I've created a bitbucket here to track them: https://bitbucket.org/galaxy/galaxy-central/issue/678/some-user-and-library-... --nate
Thanks so much in advance, Oren
On 11/10/2011 10:36 AM, Nate Coraor wrote:
On Nov 9, 2011, at 6:14 PM, Oren Livne wrote:
Dear All, Is it possible to delete a galaxy user or multiple users with a UI call or an API call?
Hi Oren,
Deleting users via the API is not currently implemented, but it can be done under the admin panel in the UI. Adding it to the API would likely be fairly trivial.
--nate
Thanks, Oren ___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
Dear Nate, Uncommenting those three lines worked. I also tried to implement a change to the Grids feature that would allow injecting app.config into Grids, but this doesn't work yet. (Are all variables such as operations and standard_filters read and used by the framework as static vars even before a UserListGrid object is created?) I can now see the Delete, Undelete and Purge buttons. Is there a way to permanently delete a user from the database? What does the purge feature do? Thanks so much, Oren
Hi Oren,
Hrm, it looks like the option to delete users was removed from the interface since it couldn't be made conditional on a configuration setting (due to a limitation in Galaxy's "Grids" feature, which is used to display the table of users in the UI). They can be added by uncommented lines 98-100 in lib/galaxy/web/controllers/admin.py:
#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 ) )
On Nov 10, 2011, at 1:40 PM, Oren Livne wrote:
Dear Nate,
Uncommenting those three lines worked. I also tried to implement a change to the Grids feature that would allow injecting app.config into Grids, but this doesn't work yet. (Are all variables such as operations and standard_filters read and used by the framework as static vars even before a UserListGrid object is created?)
Hi Oren, Unfortunately, I'm not familiar enough with Grids to be able to answer this off the top of my head.
I can now see the Delete, Undelete and Purge buttons. Is there a way to permanently delete a user from the database? What does the purge feature do?
There's no way to do this from the Galaxy application, since it breaks one of Galaxy's goals of permanence and reproducibility. There are quite a few references to user records in other tables, so deleting the user would leave these dangling. Purging a user removes all of the user's saved data from the instance. --nate
Thanks so much, Oren
Hi Oren,
Hrm, it looks like the option to delete users was removed from the interface since it couldn't be made conditional on a configuration setting (due to a limitation in Galaxy's "Grids" feature, which is used to display the table of users in the UI). They can be added by uncommented lines 98-100 in lib/galaxy/web/controllers/admin.py:
#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 ) )
On Nov 10, 2011, at 4:48 PM, Nate Coraor wrote:
On Nov 10, 2011, at 1:40 PM, Oren Livne wrote:
Dear Nate,
Uncommenting those three lines worked. I also tried to implement a change to the Grids feature that would allow injecting app.config into Grids, but this doesn't work yet. (Are all variables such as operations and standard_filters read and used by the framework as static vars even before a UserListGrid object is created?)
Hi Oren,
Unfortunately, I'm not familiar enough with Grids to be able to answer this off the top of my head.
The best approach for doing this is to change grid attributes in a method whose signature includes trans ( so you have access to things like trans.app, etc ) before the method renders the grid. Using this approach, we should be able to check a config setting before rendering the UserLisGrid so that the delete / purge Grid operations are rendered based on the config setting (rather than being commented out ). The current code in the UserListGrid is very old and needs updating in this way. I am in the middle of other stuff currently, but I'll try to take a look at this shortly ( unless other get a chance first ). Greg Von Kuster Galaxy Development Team greg@bx.psu.edu
This issue has been corrected in change set 6261:26da65326612. The config setting "allow_user_deletion" in universe_wsgi.ini must be set to true for the operation buttons to be rendered. On Nov 10, 2011, at 5:07 PM, Greg Von Kuster wrote:
On Nov 10, 2011, at 4:48 PM, Nate Coraor wrote:
On Nov 10, 2011, at 1:40 PM, Oren Livne wrote:
Dear Nate,
Uncommenting those three lines worked. I also tried to implement a change to the Grids feature that would allow injecting app.config into Grids, but this doesn't work yet. (Are all variables such as operations and standard_filters read and used by the framework as static vars even before a UserListGrid object is created?)
Hi Oren,
Unfortunately, I'm not familiar enough with Grids to be able to answer this off the top of my head.
The best approach for doing this is to change grid attributes in a method whose signature includes trans ( so you have access to things like trans.app, etc ) before the method renders the grid. Using this approach, we should be able to check a config setting before rendering the UserLisGrid so that the delete / purge Grid operations are rendered based on the config setting (rather than being commented out ). The current code in the UserListGrid is very old and needs updating in this way. I am in the middle of other stuff currently, but I'll try to take a look at this shortly ( unless other get a chance first ).
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu
participants (3)
-
Greg Von Kuster
-
Nate Coraor
-
Oren Livne