5 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/5e12fae63066/ changeset: 5e12fae63066 user: jmchilton date: 2012-08-22 04:05:53 summary: Roles API bug fixes. affected #: 1 file diff -r e27c236c05e5d65f3ce92f271a712419e7fd73a5 -r 5e12fae63066b12cf3f7f4342ad0ebecb5407a72 lib/galaxy/web/api/roles.py --- a/lib/galaxy/web/api/roles.py +++ b/lib/galaxy/web/api/roles.py @@ -17,7 +17,7 @@ """ rval = [] for role in trans.sa_session.query( trans.app.model.Role ).filter( trans.app.model.Role.table.c.deleted == False ): - if trans.app.security_agent.ok_to_display( trans.user, role ): + if trans.user_is_admin() or trans.app.security_agent.ok_to_display( trans.user, role ): item = role.get_api_value( value_mapper={ 'id': trans.security.encode_id } ) encoded_id = trans.security.encode_id( role.id ) item['url'] = url_for( 'role', id=encoded_id ) @@ -32,7 +32,7 @@ """ role_id = id try: - role_id = trans.security.decode_id( role_id ) + decoded_role_id = trans.security.decode_id( role_id ) except TypeError: trans.response.status = 400 return "Malformed role id ( %s ) specified, unable to decode." % str( role_id ) @@ -40,7 +40,7 @@ role = trans.sa_session.query( trans.app.model.Role ).get( decoded_role_id ) except: role = None - if not role or not trans.app.security_agent.ok_to_display( trans.user, role ): + if not role or not (trans.user_is_admin() or trans.app.security_agent.ok_to_display( trans.user, role )): trans.response.status = 400 return "Invalid role id ( %s ) specified." % str( role_id ) item = role.get_api_value( view='element', value_mapper={ 'id': trans.security.encode_id } ) https://bitbucket.org/galaxy/galaxy-central/changeset/558547d5329f/ changeset: 558547d5329f user: jmchilton date: 2012-08-22 06:05:05 summary: Fix library permissions API which has been broken since security API changes in 8731db1b2bfb (June 2011). affected #: 1 file diff -r 5e12fae63066b12cf3f7f4342ad0ebecb5407a72 -r 558547d5329f49cad685056cd4284e8e7661cffc lib/galaxy/web/api/permissions.py --- a/lib/galaxy/web/api/permissions.py +++ b/lib/galaxy/web/api/permissions.py @@ -40,10 +40,10 @@ role_params = params.get( k + '_in', [] ) in_roles = [ trans.sa_session.query( trans.app.model.Role ).get( trans.security.decode_id( x ) ) for x in util.listify( role_params ) ] permissions[ trans.app.security_agent.get_action( v.action ) ] = in_roles - trans.app.security_agent.set_all_library_permissions( library, permissions ) + trans.app.security_agent.set_all_library_permissions( trans, library, permissions ) trans.sa_session.refresh( library ) # Copy the permissions to the root folder - trans.app.security_agent.copy_library_permissions( library, library.root_folder ) + trans.app.security_agent.copy_library_permissions( trans, library, library.root_folder ) message = "Permissions updated for library '%s'." % library.name item = library.get_api_value( view='element' ) https://bitbucket.org/galaxy/galaxy-central/changeset/a186a4bd7bae/ changeset: a186a4bd7bae user: jmchilton date: 2012-08-22 23:57:04 summary: Create method in libraries API should return the created library not an array containing only the created library. This was confirmed by dannon in the comments on issue 802. affected #: 1 file diff -r 558547d5329f49cad685056cd4284e8e7661cffc -r a186a4bd7bae84459de066b22d49e226e2112ce1 lib/galaxy/web/api/libraries.py --- a/lib/galaxy/web/api/libraries.py +++ b/lib/galaxy/web/api/libraries.py @@ -98,7 +98,7 @@ rval['url'] = url_for( 'library', id=encoded_id ) rval['name'] = name rval['id'] = encoded_id - return [ rval ] + return rval @web.expose_api def delete( self, trans, id, **kwd ): https://bitbucket.org/galaxy/galaxy-central/changeset/bec712216582/ changeset: bec712216582 user: jmchilton date: 2012-08-23 00:05:53 summary: Include created history url in json rendered by histories API on successful history creation. Dannon verified this is the desired behvaior in the comments on issue 802 in bitbucket. affected #: 1 file diff -r a186a4bd7bae84459de066b22d49e226e2112ce1 -r bec712216582134338a733ccd85bc4dac25353c4 lib/galaxy/web/api/histories.py --- a/lib/galaxy/web/api/histories.py +++ b/lib/galaxy/web/api/histories.py @@ -109,6 +109,7 @@ trans.sa_session.add( new_history ) trans.sa_session.flush() item = new_history.get_api_value(view='element', value_mapper={'id':trans.security.encode_id}) + item['url'] = url_for( 'history', id=item['id'] ) return item @web.expose_api https://bitbucket.org/galaxy/galaxy-central/changeset/c06d0ea23c90/ changeset: c06d0ea23c90 user: dannon date: 2012-08-23 15:34:43 summary: Merged in jmchilton/galaxy-central-roles-api-fixes (pull request #62) affected #: 4 files diff -r 146d0f4c29decefb441a7133b4aa16442afdacb1 -r c06d0ea23c902e13a5d38ed56ab8cad53130fea5 lib/galaxy/web/api/histories.py --- a/lib/galaxy/web/api/histories.py +++ b/lib/galaxy/web/api/histories.py @@ -109,6 +109,7 @@ trans.sa_session.add( new_history ) trans.sa_session.flush() item = new_history.get_api_value(view='element', value_mapper={'id':trans.security.encode_id}) + item['url'] = url_for( 'history', id=item['id'] ) return item @web.expose_api diff -r 146d0f4c29decefb441a7133b4aa16442afdacb1 -r c06d0ea23c902e13a5d38ed56ab8cad53130fea5 lib/galaxy/web/api/libraries.py --- a/lib/galaxy/web/api/libraries.py +++ b/lib/galaxy/web/api/libraries.py @@ -98,7 +98,7 @@ rval['url'] = url_for( 'library', id=encoded_id ) rval['name'] = name rval['id'] = encoded_id - return [ rval ] + return rval @web.expose_api def delete( self, trans, id, **kwd ): diff -r 146d0f4c29decefb441a7133b4aa16442afdacb1 -r c06d0ea23c902e13a5d38ed56ab8cad53130fea5 lib/galaxy/web/api/permissions.py --- a/lib/galaxy/web/api/permissions.py +++ b/lib/galaxy/web/api/permissions.py @@ -40,10 +40,10 @@ role_params = params.get( k + '_in', [] ) in_roles = [ trans.sa_session.query( trans.app.model.Role ).get( trans.security.decode_id( x ) ) for x in util.listify( role_params ) ] permissions[ trans.app.security_agent.get_action( v.action ) ] = in_roles - trans.app.security_agent.set_all_library_permissions( library, permissions ) + trans.app.security_agent.set_all_library_permissions( trans, library, permissions ) trans.sa_session.refresh( library ) # Copy the permissions to the root folder - trans.app.security_agent.copy_library_permissions( library, library.root_folder ) + trans.app.security_agent.copy_library_permissions( trans, library, library.root_folder ) message = "Permissions updated for library '%s'." % library.name item = library.get_api_value( view='element' ) diff -r 146d0f4c29decefb441a7133b4aa16442afdacb1 -r c06d0ea23c902e13a5d38ed56ab8cad53130fea5 lib/galaxy/web/api/roles.py --- a/lib/galaxy/web/api/roles.py +++ b/lib/galaxy/web/api/roles.py @@ -17,7 +17,7 @@ """ rval = [] for role in trans.sa_session.query( trans.app.model.Role ).filter( trans.app.model.Role.table.c.deleted == False ): - if trans.app.security_agent.ok_to_display( trans.user, role ): + if trans.user_is_admin() or trans.app.security_agent.ok_to_display( trans.user, role ): item = role.get_api_value( value_mapper={ 'id': trans.security.encode_id } ) encoded_id = trans.security.encode_id( role.id ) item['url'] = url_for( 'role', id=encoded_id ) @@ -32,7 +32,7 @@ """ role_id = id try: - role_id = trans.security.decode_id( role_id ) + decoded_role_id = trans.security.decode_id( role_id ) except TypeError: trans.response.status = 400 return "Malformed role id ( %s ) specified, unable to decode." % str( role_id ) @@ -40,7 +40,7 @@ role = trans.sa_session.query( trans.app.model.Role ).get( decoded_role_id ) except: role = None - if not role or not trans.app.security_agent.ok_to_display( trans.user, role ): + if not role or not (trans.user_is_admin() or trans.app.security_agent.ok_to_display( trans.user, role )): trans.response.status = 400 return "Invalid role id ( %s ) specified." % str( role_id ) item = role.get_api_value( view='element', value_mapper={ 'id': trans.security.encode_id } ) 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.