mirror of
https://github.com/moghtech/komodo.git
synced 2026-03-11 17:44:19 -05:00
fix build permissions
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user