From 1cc73a606d5493dbe1afb30cd410690de2eb4708 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Tue, 27 Jun 2023 11:56:50 +0200 Subject: [PATCH] [IMP] runbot: allow only advanced users to wake up a child As it happens that some users are waking up child builds, let's only allow advanced users to do that. --- runbot/models/build.py | 2 ++ runbot/templates/utils.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/runbot/models/build.py b/runbot/models/build.py index b8518e51..fd4f0e47 100644 --- a/runbot/models/build.py +++ b/runbot/models/build.py @@ -996,6 +996,8 @@ class BuildResult(models.Model): self._log('wake_up', f'Wake up initiated by {user.name}') if self.local_state != 'done': self._log('wake_up', 'Impossibe to wake up, state is not done') + elif self.parent_id and not user.has_group('runbot.group_runbot_advanced_user'): + self._log('wake_up', 'Waking up child builds is for advanced users only') else: self.requested_action = 'wake_up' diff --git a/runbot/templates/utils.xml b/runbot/templates/utils.xml index 98488932..a4ec61cf 100644 --- a/runbot/templates/utils.xml +++ b/runbot/templates/utils.xml @@ -219,7 +219,7 @@ - +