From 8d1639bcaff292f04c5f865dd6c08d549b26d39c Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Wed, 1 Mar 2023 10:18:58 +0000 Subject: [PATCH] fix build permissions --- core/src/actions/build.rs | 2 +- frontend/src/components/Description.tsx | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/actions/build.rs b/core/src/actions/build.rs index 8edffb704..ed5cd7cdc 100644 --- a/core/src/actions/build.rs +++ b/core/src/actions/build.rs @@ -255,7 +255,7 @@ impl State { async fn build_inner(&self, build_id: &str, user: &RequestUser) -> anyhow::Result { let mut build = self - .get_build_check_permissions(build_id, user, PermissionLevel::Update) + .get_build_check_permissions(build_id, user, PermissionLevel::Execute) .await?; build.version.increment(); let mut update = Update { diff --git a/frontend/src/components/Description.tsx b/frontend/src/components/Description.tsx index aef07cd6a..0cfb2007c 100644 --- a/frontend/src/components/Description.tsx +++ b/frontend/src/components/Description.tsx @@ -76,6 +76,7 @@ const DescriptionMenu: Component<{ const [desc, setDesc] = createSignal(p.description); const [loading, setLoading] = createSignal(false); const update_description = () => { + if (!p.userCanUpdate) return; setLoading(true); client .update_description({ target: p.target, description: desc() || "" }) @@ -113,10 +114,12 @@ const DescriptionMenu: Component<{ style={{ width: "700px", "max-width": "90vw", padding: "1rem" }} disabled={!p.userCanUpdate} /> - }> - + + }> + + );