diff --git a/client/src/components/User/UserPreferences.vue b/client/src/components/User/UserPreferences.vue index 0eb8a0c4d5e2..b186dac1092b 100644 --- a/client/src/components/User/UserPreferences.vue +++ b/client/src/components/User/UserPreferences.vue @@ -243,7 +243,7 @@ export default { _l( "WARNING: This will make all datasets (excluding library datasets) for which you have " + "'management' permissions, in all of your histories " + - "private, and will set permissions such that all " + + "private (including archived and purged), and will set permissions such that all " + "of your new data in these histories is created as private. Any " + "datasets within that are currently shared will need " + "to be re-shared or published. Are you sure you " + diff --git a/lib/galaxy/webapps/galaxy/controllers/history.py b/lib/galaxy/webapps/galaxy/controllers/history.py index fd3f1a036f20..5a7824fd3129 100644 --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -123,7 +123,7 @@ def display_by_username_and_slug(self, trans, username, slug, **kwargs): ) ) - @web.legacy_expose_api + @web.expose_api @web.require_login("changing default permissions") def permissions(self, trans, payload=None, **kwd): """ @@ -131,7 +131,7 @@ def permissions(self, trans, payload=None, **kwd): """ history_id = kwd.get("id") if not history_id: - return self.message_exception(trans, f"Invalid history id ({str(history_id)}) received") + raise exceptions.RequestParameterMissingException("No history id received") history = self.history_manager.get_owned(self.decode_id(history_id), trans.user, current_history=trans.history) if trans.request.method == "GET": inputs = [] @@ -166,7 +166,7 @@ def permissions(self, trans, payload=None, **kwd): trans.app.security_agent.history_set_default_permissions(history, permissions) return {"message": "Default history '%s' dataset permissions have been changed." % history.name} - @web.legacy_expose_api + @web.expose_api @web.require_login("make datasets private") def make_private(self, trans, history_id=None, all_histories=False, **kwd): """ @@ -184,7 +184,7 @@ def make_private(self, trans, history_id=None, all_histories=False, **kwd): if history: histories.append(history) if not histories: - return self.message_exception(trans, "Invalid history or histories specified.") + raise exceptions.RequestParameterMissingException("No history or histories specified.") private_role = trans.app.security_agent.get_private_user_role(trans.user) user_roles = trans.user.all_roles() private_permissions = { @@ -192,7 +192,6 @@ def make_private(self, trans, history_id=None, all_histories=False, **kwd): trans.app.security_agent.permitted_actions.DATASET_ACCESS: [private_role], } for history in histories: - self.history_manager.error_unless_mutable(history) # Set default role for history to private trans.app.security_agent.history_set_default_permissions(history, private_permissions) # Set private role for all datasets @@ -204,8 +203,6 @@ def make_private(self, trans, history_id=None, all_histories=False, **kwd): ): # If it's not private to me, and I can manage it, set fixed private permissions. trans.app.security_agent.set_all_dataset_permissions(hda.dataset, private_permissions) - if not trans.app.security_agent.dataset_is_private_to_user(trans, hda.dataset): - raise exceptions.InternalServerError("An error occurred and the dataset is NOT private.") return { "message": f"Success, requested permissions have been changed in {'all histories' if all_histories else history.name}." } @@ -256,12 +253,12 @@ def resume_paused_jobs(self, trans, current=False, ids=None, **kwargs): return trans.show_ok_message("Your jobs have been resumed.", refresh_frames=refresh_frames) # TODO: used in index.mako - @web.legacy_expose_api + @web.expose_api @web.require_login("rename histories") def rename(self, trans, payload=None, **kwd): id = kwd.get("id") if not id: - return self.message_exception(trans, "No history id received for renaming.") + raise exceptions.RequestParameterMissingException("No history id received for renaming.") user = trans.get_user() id = listify(id) histories = []