From efe9c68e9aea541a5eae4b9a8bf0d21a9c13a48f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 6 Mar 2023 16:12:41 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20use=20of=20TIMELAPSE=5FMAN?= =?UTF-8?q?AGE=5FUNRENDERED?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/timelapse.rst | 4 ++-- src/octoprint/access/permissions.py | 2 +- src/octoprint/static/js/app/viewmodels/timelapse.js | 12 ++++++++++-- src/octoprint/templates/tabs/timelapse.jinja2 | 6 +++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/api/timelapse.rst b/docs/api/timelapse.rst index 6a49a631d..c7f5a3767 100644 --- a/docs/api/timelapse.rst +++ b/docs/api/timelapse.rst @@ -48,7 +48,7 @@ Issue a command for an unrendered timelapse Current only supports to render the unrendered timelapse ``name`` via the ``render`` command. - Requires the ``TIMELAPSE_ADMIN`` permission. + Requires the ``TIMELAPSE_MANAGE_UNRENDERED`` permission. :json command: The command to issue, currently only ``render`` is supported @@ -64,7 +64,7 @@ Delete an unrendered timelapse Returns a :ref:`timelapse list ` in the response body. - Requires the ``TIMELAPSE_DELETE`` permission. + Requires the ``TIMELAPSE_MANAGE_UNRENDERED`` permission. :param unrendered: If provided and true, also include unrendered timelapses in the response diff --git a/src/octoprint/access/permissions.py b/src/octoprint/access/permissions.py index 311f3172c..91b3fa7bb 100644 --- a/src/octoprint/access/permissions.py +++ b/src/octoprint/access/permissions.py @@ -414,7 +414,7 @@ class Permissions(metaclass=PermissionsMetaClass): ) TIMELAPSE_DELETE = OctoPrintPermission( "Timelapse Delete", - gettext("Allows to delete timelapse videos and unrendered timelapses"), + gettext("Allows to delete timelapse videos"), RoleNeed("timelapse_delete"), default_groups=[USER_GROUP], ) diff --git a/src/octoprint/static/js/app/viewmodels/timelapse.js b/src/octoprint/static/js/app/viewmodels/timelapse.js index b7ae602b9..414c2aaad 100644 --- a/src/octoprint/static/js/app/viewmodels/timelapse.js +++ b/src/octoprint/static/js/app/viewmodels/timelapse.js @@ -443,7 +443,11 @@ $(function () { }; self.removeUnrendered = function (name) { - if (!self.loginState.hasPermission(self.access.permissions.TIMELAPSE_DELETE)) + if ( + !self.loginState.hasPermission( + self.access.permissions.TIMELAPSE_MANAGE_UNRENDERED + ) + ) return; var perform = function () { @@ -463,7 +467,11 @@ $(function () { }; self.removeMarkedUnrendered = function () { - if (!self.loginState.hasPermission(self.access.permissions.TIMELAPSE_DELETE)) + if ( + !self.loginState.hasPermission( + self.access.permissions.TIMELAPSE_MANAGE_UNRENDERED + ) + ) return; var perform = function () { diff --git a/src/octoprint/templates/tabs/timelapse.jinja2 b/src/octoprint/templates/tabs/timelapse.jinja2 index 597a44222..6affc0421 100644 --- a/src/octoprint/templates/tabs/timelapse.jinja2 +++ b/src/octoprint/templates/tabs/timelapse.jinja2 @@ -194,7 +194,7 @@
{{ _('Unrendered Timelapses') }}
-
+