details:
http://www.bx.psu.edu/hg/galaxy/rev/ed6bfb311fb0
changeset: 2361:ed6bfb311fb0
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Wed Apr 22 12:13:29 2009 -0400
description:
Fixes for copying library permissions, do not set permissions for the current user when
changing permissions on library items.
3 file(s) affected in this change:
lib/galaxy/security/__init__.py
lib/galaxy/web/controllers/admin.py
lib/galaxy/web/controllers/library.py
diffs (62 lines):
diff -r 2751a34dbd4b -r ed6bfb311fb0 lib/galaxy/security/__init__.py
--- a/lib/galaxy/security/__init__.py Wed Apr 22 10:57:07 2009 -0400
+++ b/lib/galaxy/security/__init__.py Wed Apr 22 12:13:29 2009 -0400
@@ -382,7 +382,7 @@
permissions[role_assoc.action] = [ role_assoc.role ]
self.set_all_library_permissions( target_library_item, permissions )
if user:
- # Make sure user's private role is included
+ # The user passed will be the current Galaxy user. Make sure user's
private role is included
item_class = None
for item_class, permission_class, info_association_class in
self.library_item_assocs:
if isinstance( target_library_item, item_class ):
@@ -396,7 +396,6 @@
else:
raise 'Invalid class (%s) specified for target_library_item (%s)'
% ( target_library_item.__class__, target_library_item.__class__.__name__ )
def show_library_item( self, user, library_item ):
- # TODO: possibly needs to support other library item types
if self.allow_action( user, self.permitted_actions.LIBRARY_MODIFY,
library_item=library_item ) or \
self.allow_action( user, self.permitted_actions.LIBRARY_MANAGE,
library_item=library_item ) or \
self.allow_action( user, self.permitted_actions.LIBRARY_ADD,
library_item=library_item ):
diff -r 2751a34dbd4b -r ed6bfb311fb0 lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py Wed Apr 22 10:57:07 2009 -0400
+++ b/lib/galaxy/web/controllers/admin.py Wed Apr 22 12:13:29 2009 -0400
@@ -935,7 +935,7 @@
trans.app.security_agent.set_all_library_permissions( library,
permissions )
library.refresh()
# Copy the permissions to the root folder
- trans.app.security_agent.copy_library_permissions( library,
library.root_folder, user=trans.get_user() )
+ trans.app.security_agent.copy_library_permissions( library,
library.root_folder )
msg = "Permissions updated for library '%s'" %
library.name
return trans.response.send_redirect( web.url_for(
controller='admin',
action='library',
@@ -1058,7 +1058,7 @@
folder.add_folder( new_folder )
new_folder.flush()
# New folders default to having the same permissions as their parent
folder
- trans.app.security_agent.copy_library_permissions( folder, new_folder,
user=trans.get_user() )
+ trans.app.security_agent.copy_library_permissions( folder, new_folder )
msg = "New folder named '%s' has been added to the
library" % new_folder.name
return trans.response.send_redirect( web.url_for(
controller='admin',
action='browse_library',
diff -r 2751a34dbd4b -r ed6bfb311fb0 lib/galaxy/web/controllers/library.py
--- a/lib/galaxy/web/controllers/library.py Wed Apr 22 10:57:07 2009 -0400
+++ b/lib/galaxy/web/controllers/library.py Wed Apr 22 12:13:29 2009 -0400
@@ -137,7 +137,7 @@
trans.app.security_agent.set_all_library_permissions( library,
permissions )
library.refresh()
# Copy the permissions to the root folder
- trans.app.security_agent.copy_library_permissions( library,
library.root_folder, user=trans.get_user() )
+ trans.app.security_agent.copy_library_permissions( library,
library.root_folder )
msg = "Permissions updated for library '%s'" %
library.name
return trans.response.send_redirect( web.url_for(
controller='library',
action='library',
@@ -934,7 +934,7 @@
folder.add_folder( new_folder )
new_folder.flush()
# New folders default to having the same permissions as their parent
folder
- trans.app.security_agent.copy_library_permissions( folder, new_folder,
user=trans.get_user() )
+ trans.app.security_agent.copy_library_permissions( folder, new_folder )
msg = "New folder named '%s' has been added to the
library" % new_folder.name
return trans.response.send_redirect( web.url_for(
controller='library',
action='browse_library',