docs: describe the Hub read-only flag as set on the whole script

This commit is contained in:
AlexRV12
2026-12-03 11:28:18 +01:00
parent c52fc93ed6
commit 894fa1199e
4 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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")]
+2 -1
View File
@@ -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,
+3 -2
View File
@@ -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/<id>/…` 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