mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-11-20 16:09:26 +00:00
* feat: configurable workspace roles with per-workspace overrides Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: close role review gaps in pickers, declarative sync and removal Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: keep resolve_role_name doc on its function Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: validate overrides on instance role changes and bill admins fully Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: allow pipeline drafts and keep role checks on one connection Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: list data pipelines in operator_can_draft Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: expect a 403 role refusal when an operator resolves jobs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: require a valid license for custom workspace roles Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: freeze workspace roles when the license lapses Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: pin the ee companion for workspace roles Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor: broadcast role override changes from the write path, not a trigger Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: update ee-repo-ref to b5294d38db082bdd104d5358a47695390694c05d This commit updates the EE repository reference after PR #891 was merged in windmill-ee-private. Previous ee-repo-ref: 688e00c5982865b14098f530d54280e2311994c0 New ee-repo-ref: b5294d38db082bdd104d5358a47695390694c05d Automated by sync-ee-ref workflow. * feat: add workspace roles settings UI and role pickers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: show the server's reason when a settings save fails Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: default role pickers to a defined role and confirm resets of unknown capabilities Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: treat null role capabilities as unset and key role drafts by map Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat: gate the frontend on workspace role capabilities Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: gate deploys, bulk actions and chat composition per role kind Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: treat a superadmin as full in deploy permission checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: leave page visibility out of isRestricted, as the server does Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: let a member discard their own draft without the authoring right Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: show custom roles as inactive without a valid license Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: keep the user store import on the agent page Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: show custom roles as frozen without a valid license Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: reorder instance roles with a drag handle Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: let an admin row that kept the operator flag hold full rights everywhere Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: treat superadmin members as admins and return role names from get user Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: move the instance role label into the expanded panel Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
132 lines
3.5 KiB
Svelte
132 lines
3.5 KiB
Svelte
<script lang="ts">
|
|
import { SCRIPT_VIEW_SHOW_SCHEDULE_RUN_LATER } from '$lib/consts'
|
|
import Label from './Label.svelte'
|
|
import Toggle from './Toggle.svelte'
|
|
import Tooltip from './Tooltip.svelte'
|
|
import { roleCapabilities, userStore, workerTags, workspaceStore } from '$lib/stores'
|
|
import { Button } from './common'
|
|
import { WorkerService } from '$lib/gen'
|
|
import DateTimeInput from './DateTimeInput.svelte'
|
|
import { useOperatingWorkspace } from '$lib/components/operatingWorkspace.svelte'
|
|
|
|
interface Props {
|
|
runnable:
|
|
| {
|
|
summary?: string
|
|
description?: string
|
|
path?: string
|
|
is_template?: boolean
|
|
hash?: string
|
|
kind?: string
|
|
can_write?: boolean
|
|
created_at?: string
|
|
created_by?: string
|
|
extra_perms?: Record<string, boolean>
|
|
}
|
|
| undefined
|
|
scheduledForStr: string | undefined
|
|
invisible_to_owner: boolean | undefined
|
|
overrideTag: string | undefined
|
|
}
|
|
|
|
let {
|
|
runnable,
|
|
scheduledForStr = $bindable(),
|
|
invisible_to_owner = $bindable(),
|
|
overrideTag = $bindable()
|
|
}: Props = $props()
|
|
// As in WorkerTagPicker: the shared `workerTags` cache is the navigation workspace's, so
|
|
// tags of another operating workspace live in a local list rather than overwriting it.
|
|
const operatingWorkspace = useOperatingWorkspace()
|
|
let usesLocal = $derived($operatingWorkspace !== $workspaceStore)
|
|
let localWorkerTags = $state<string[] | undefined>(undefined)
|
|
let currentTags = $derived(usesLocal ? localWorkerTags : $workerTags)
|
|
|
|
loadWorkerGroups()
|
|
|
|
async function loadWorkerGroups() {
|
|
if (usesLocal) {
|
|
localWorkerTags ??= await WorkerService.getCustomTagsForWorkspace({
|
|
workspace: $operatingWorkspace!
|
|
})
|
|
} else if (!$workerTags) {
|
|
$workerTags = await WorkerService.getCustomTagsForWorkspace({ workspace: $workspaceStore! })
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<div class="flex flex-col gap-4 p-4">
|
|
<div class="flex flex-col gap-2">
|
|
{#if SCRIPT_VIEW_SHOW_SCHEDULE_RUN_LATER}
|
|
<div class="">
|
|
<Label label="Schedule to run later" />
|
|
|
|
<div class="flex flex-row items-center my-1">
|
|
<div>
|
|
<label for="run-time"></label>
|
|
<DateTimeInput
|
|
value={scheduledForStr}
|
|
on:change={(e) => {
|
|
console.log('e.detail', e.detail)
|
|
scheduledForStr = e.detail
|
|
}}
|
|
/>
|
|
</div>
|
|
<Button
|
|
variant="default"
|
|
size="xs"
|
|
btnClasses="mx-2 "
|
|
on:click={() => {
|
|
scheduledForStr = undefined
|
|
}}
|
|
>
|
|
Clear
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
{#if $roleCapabilities.code}
|
|
{#if currentTags && currentTags.length > 0}
|
|
<div class="w-full">
|
|
<select
|
|
placeholder="Worker group"
|
|
bind:value={
|
|
() => overrideTag ?? '',
|
|
(v) => {
|
|
if (v == '') {
|
|
overrideTag = undefined
|
|
} else {
|
|
overrideTag = v
|
|
}
|
|
}
|
|
}
|
|
>
|
|
{#if overrideTag}
|
|
<option value="">reset to default</option>
|
|
{:else}
|
|
<option value="" disabled selected>Override Worker Group Tag</option>
|
|
{/if}
|
|
{#each currentTags ?? [] as tag (tag)}
|
|
<option value={tag}>{tag}</option>
|
|
{/each}
|
|
</select>
|
|
</div>
|
|
{/if}
|
|
{/if}
|
|
|
|
{#if runnable?.path?.startsWith(`u/${$userStore?.username}`) != true && (runnable?.path?.split('/')?.length ?? 0) > 2}
|
|
<div class="flex items-center gap-1">
|
|
<Toggle
|
|
options={{
|
|
right: `make run invisible to others`
|
|
}}
|
|
bind:checked={invisible_to_owner}
|
|
/>
|
|
<Tooltip
|
|
>By default, runs are visible to the owner(s) of the script or flow being triggered</Tooltip
|
|
>
|
|
</div>
|
|
{/if}
|
|
</div>
|