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

Allow libraries function set_permission public lib and dataset #490

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions bioblend/galaxy/libraries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,13 +748,13 @@ def set_library_permissions(
:return: General information about the library
"""
payload: Dict[str, List[str]] = {}
if access_in:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this test failed for access_in being None or []. Now only for None. Is this desired?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think [] make things unrestricted and is desired in create public data library.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test that shows this?

I'm also not entirely sure what you mean with "I want to make the library and dataset public". Has this not been possible before. Again, a test would be highly appreciated.

if access_in is not None:
payload["LIBRARY_ACCESS_in"] = access_in
if modify_in:
if modify_in is not None:
payload["LIBRARY_MODIFY_in"] = modify_in
if add_in:
if add_in is not None:
payload["LIBRARY_ADD_in"] = add_in
if manage_in:
if manage_in is not None:
payload["LIBRARY_MANAGE_in"] = manage_in
url = self._make_url(library_id) + "/permissions"
return self._post(payload, url=url)
Expand Down Expand Up @@ -789,11 +789,11 @@ def set_dataset_permissions(
payload: Dict[str, Any] = {
"action": "set_permissions",
}
if access_in:
if access_in is not None:
payload["access_ids[]"] = access_in
if modify_in:
if modify_in is not None:
payload["modify_ids[]"] = modify_in
if manage_in:
if manage_in is not None:
payload["manage_ids[]"] = manage_in
url = "/".join((self._make_url(), "datasets", dataset_id, "permissions"))
return self._post(payload, url=url)
Loading