Skip to content

Commit

Permalink
Allow libraries function set_permission public lib and dataset
Browse files Browse the repository at this point in the history
Hi Galaxy
I work with this API methods using this library. Such a wonderful lib
By the way, if I want to make the library and dataset public, I think we can adjust like I committed
Long to hear if this will make the user feel better
  • Loading branch information
minhtrung1997 authored Sep 23, 2024
1 parent 5b6cb7a commit 8dbad16
Showing 1 changed file with 7 additions and 7 deletions.
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:
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)

1 comment on commit 8dbad16

@minhtrung1997
Copy link
Author

Choose a reason for hiding this comment

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

I can set public access by:
gi.libraries.set_library_permissions(<data-lib-id>, access_in = [])

Please sign in to comment.