fix build permissions

This commit is contained in:
mbecker20
2023-03-01 10:18:58 +00:00
parent e2446af00e
commit 8d1639bcaf
2 changed files with 8 additions and 5 deletions

View File

@@ -255,7 +255,7 @@ impl State {
async fn build_inner(&self, build_id: &str, user: &RequestUser) -> anyhow::Result<Update> {
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 {

View File

@@ -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}
/>
<Show when={!loading()} fallback={<Loading />}>
<button class="green" onClick={update_description}>
update
</button>
<Show when={p.userCanUpdate}>
<Show when={!loading()} fallback={<Loading />}>
<button class="green" onClick={update_description}>
update
</button>
</Show>
</Show>
</Grid>
);