Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A round of data libraries improvements. #4512

Merged
merged 16 commits into from Sep 4, 2017

Conversation

Projects
None yet
5 participants
@martenson
Copy link
Member

commented Aug 29, 2017

  • add new PATCH API for modifying library datasets which operates on the connected (latest) ldda
  • add frontend functionality to leverage new API
  • use more of base manager
  • renamed lda_datasets.py to library_datasets.py to remove confusion
  • remove unused code

martenson added some commits Mar 30, 2017

martenson added some commits Aug 30, 2017

@martenson martenson added status/review and removed status/WIP labels Aug 30, 2017

@martenson

This comment has been minimized.

Copy link
Member Author

commented Aug 30, 2017

once tests finish this should be ready for review

@martenson martenson referenced this pull request Aug 30, 2017

Closed

Library system is only barely functional #4166

5 of 9 tasks complete

@galaxybot galaxybot added this to the 17.09 milestone Aug 31, 2017

@bgruening

This comment has been minimized.

Copy link
Member

commented Sep 3, 2017

This is super cool Martin!

@jmchilton

This comment has been minimized.

Copy link
Member

commented Sep 4, 2017

Started working on tests for libraries to test this against (#4543) but I ran out of steam and got stumped on a couple odd issues. In manual testing everything seemed fine though. Thanks for the work @martenson!

@jmchilton jmchilton merged commit 3d9809a into galaxyproject:dev Sep 4, 2017

6 checks passed

api test Build finished. 286 tests run, 0 skipped, 0 failed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
framework test Build finished. 161 tests run, 0 skipped, 0 failed.
Details
integration test Build finished. 44 tests run, 0 skipped, 0 failed.
Details
lgtm analysis: JavaScript No alert changes
Details
toolshed test Build finished. 579 tests run, 0 skipped, 0 failed.
Details
@nsoranzo
Copy link
Member

left a comment

Sorry for the late review, too many incoming PRs lately (which is obviously good!).

:param check_ownership: flag whether to check that user owns the item
:type check_ownership: bool
:param check_accessible: flag whether to check that user can access item
:type check_accessible: bool

This comment has been minimized.

Copy link
@nsoranzo

nsoranzo Sep 4, 2017

Member

check_ownership and check_accessible are not parameters of this function, documentation for payload is missing instead.

if not trans.app.security_agent.can_modify_library_item(trans.get_current_user_roles(), ld):
raise InsufficientPermissionsException('You do not have proper permission to modify this library dataset.')
elif ld.deleted:
raise ObjectNotFound('Library dataset with the id provided is deleted.')

This comment has been minimized.

Copy link
@nsoranzo

nsoranzo Sep 4, 2017

Member

I think the check on deleted should be the first, admins are not allowed to modify a deleted library dataset anyway by the check on line 62. So I think this should be:

    if ld.deleted:
        raise ...
    if trans.user_is_admin():
        return ld
    if not trans.app.security_agent...
        raise ...
current_user_roles = trans.get_current_user_roles()
self.check_modifiable(trans, ld)
if ld.deleted is True:
raise ItemAccessibilityException("You cannot update a deleted library dataset. Undelete it first.")

This comment has been minimized.

Copy link
@nsoranzo

nsoranzo Sep 4, 2017

Member

If check_modifiable is modified as suggested below, this check becomes redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.