diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 7ecd4f87cb..e4b7975027 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -42300,7 +42300,7 @@ components: HubAccess: type: string enum: [read, write] - description: What a role without code may do with the Hub scripts of one integration. `read` allows only versions the Hub approved as read-only; `write` implies `read`. + description: What a role without code may do with the Hub scripts of one integration. `read` allows only the scripts an approver marked read-only on the Hub; `write` implies `read`. HubAccessList: type: object diff --git a/backend/windmill-common/src/roles.rs b/backend/windmill-common/src/roles.rs index 68388f044f..8bfcc4a327 100644 --- a/backend/windmill-common/src/roles.rs +++ b/backend/windmill-common/src/roles.rs @@ -45,7 +45,7 @@ pub enum AuthorLevel { } /// What a role without `code` may do with the Hub scripts of one integration. `Write` implies -/// `Read`: `Read` allows only versions the Hub approved as read-only. See +/// `Read`: `Read` allows only the scripts an approver marked read-only. See /// [`crate::jobs::check_can_name_runnable`]. #[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, Hash)] #[serde(rename_all = "snake_case")] diff --git a/backend/windmill-common/src/utils.rs b/backend/windmill-common/src/utils.rs index 3648069e0e..ed9b7c5cb5 100644 --- a/backend/windmill-common/src/utils.rs +++ b/backend/windmill-common/src/utils.rs @@ -674,7 +674,8 @@ pub struct HubScriptMeta { pub version_id: i32, /// The integration, as the Hub spells it ("Slack" and "slack" both occur). pub app: String, - /// Absent on a version the Hub never flagged, which counts as able to write. + /// Whether an approver marked the script read-only; the Hub reports it on each of its versions. + /// Absent counts as able to write. #[serde(default)] pub read_only: bool, pub script_approved: bool, diff --git a/docs/workspace-roles.md b/docs/workspace-roles.md index e76b35ea37..c1755f2b2d 100644 --- a/docs/workspace-roles.md +++ b/docs/workspace-roles.md @@ -54,8 +54,9 @@ would go there too. It is not part of `RoleCapabilitiesPatch`, so no role settin When `hub` is non-empty, naming `hub//…` asks the Hub (`hub_script_meta`, `GET {hub}/scripts/access_meta`, cached 5 minutes per version, with the private Hub's fallback to the public one for ids below `PRIVATE_HUB_MIN_VERSION`), and allows it when the version's `app` (from -the Hub, never the path) is listed at `write`, or at `read` and the version is read-only, and the -script is approved and this version was ever approved. A version with no flag can write. Refused +the Hub, never the path) is listed at `write`, or at `read` and the script is read-only, and the +script is approved and this version was ever approved. An approver marks the whole script read-only, +and the Hub reports it on each of its versions; a script with no flag can write. Refused otherwise, saying which: integration not allowed, script can write but is allowed at read, version not approved or not on the Hub, or the Hub unreachable or too old to answer. An empty list refuses without asking. Hub flows stay code-only. The UI offers less than the server