diff --git a/.specify/feature.json b/.specify/feature.json index 5601d620d..fef1070a9 100644 --- a/.specify/feature.json +++ b/.specify/feature.json @@ -1,3 +1,3 @@ { - "feature_directory": "specs/041-agent-turn-indicators" + "feature_directory": "specs/042-audit-access-holes" } diff --git a/admin/slices/setup/api/data/repositories/api/sdk.gen.ts b/admin/slices/setup/api/data/repositories/api/sdk.gen.ts index e332a190f..f913a78a5 100644 --- a/admin/slices/setup/api/data/repositories/api/sdk.gen.ts +++ b/admin/slices/setup/api/data/repositories/api/sdk.gen.ts @@ -1617,7 +1617,7 @@ export class FilesService { } /** - * List files for an agent. Each node says whether it is text or binary and whether it can be edited in place. + * List files for an agent. Each node says whether it is text or binary and whether it can be edited in place. Files that hold stored secrets (data/secrets/, data/channels/, data/channels.json, browser-state/) are write-only and never listed; reading, writing or deleting one answers 403. */ public static fileControllerList( options: Options, @@ -1721,7 +1721,7 @@ export class FilesService { } /** - * Download a ZIP archive of the agent’s entire S3 prefix (files, skills, runtime state). Used as a safety net before destructive actions. + * Download a ZIP archive of the agent’s entire S3 prefix (files, skills, runtime state). Used as a safety net before destructive actions. Stored secrets are write-only and not exported; when any were left out the archive holds SECRET_STORES_NOT_EXPORTED.txt. */ public static exportAgentFiles( options: Options, @@ -1777,7 +1777,7 @@ export class FilesService { } /** - * Stream the raw stored file for an open link. 401 when the token is invalid, expired or minted for another agent; 404 (plain text) when the file is gone. + * Stream the raw stored file for an open link. 401 when the token is invalid, expired or minted for another agent; 404 (plain text) when the file is gone; 403 for a file that holds stored secrets, which are write-only. */ public static readAgentFileRaw( options: Options, @@ -3149,7 +3149,7 @@ export class UsersService { } /** - * Create a user (admin sets the password) + * Create a user (admin sets the password). An Admin whose agent access is limited creates an account limited the same way: it gets a copy of the creator’s lists, and only the Owner can widen it (`agentAccess` says what it reaches). */ public static userControllerCreate( options: Options, @@ -4528,7 +4528,7 @@ export class UpgradeService { export class McpOauthService { /** - * Begin an OAuth connect for an agent. Returns the authorization URL the agent sends the user in chat. + * Begin an OAuth connect for an agent. Returns the authorization URL the agent sends the user in chat. On the Ranch assistant only the Owner connects anything: a subject that is not the Owner, and the agent-wide connection, answer 403. */ public static startMcpOauth( options: Options, diff --git a/admin/slices/user/assistantAccess/components/assistantAccess/AccountRow.vue b/admin/slices/user/assistantAccess/components/assistantAccess/AccountRow.vue index 43513b0c0..a164b3293 100644 --- a/admin/slices/user/assistantAccess/components/assistantAccess/AccountRow.vue +++ b/admin/slices/user/assistantAccess/components/assistantAccess/AccountRow.vue @@ -24,6 +24,18 @@ import { const props = defineProps<{ userId: string; name: string }>(); const store = useAssistantAccessStore(); +const auth = useAuthStore(); +const userStore = useUserStore(); + +/** + * The editor is an Admin limited to some agents (RANCH-8, FR-018): an + * ability they tick works only on agents they can see. Read from the + * viewer's own row in the user store; until it is in, nothing is said, and + * the API applies the rule either way. + */ +const grantCeilingNote = computed( + () => !!account.value?.editable && userStore.isLimitedAdmin(auth.user), +); const loadError = ref(null); const saveError = ref(null); @@ -49,7 +61,12 @@ async function load() { : messageOf(err, 'The assistant setting could not be read.'); } } -onMounted(load); +onMounted(() => { + void load(); + if (auth.user?.role === 'Admin') { + void userStore.fetchById(auth.user.id).catch(() => undefined); + } +}); watch(() => props.userId, load); const account = computed(() => store.accountOf(props.userId)); @@ -178,6 +195,10 @@ async function onAdvancedSave(choice: {

+ + Abilities you tick here work only on agents you can see. + +

+ + Abilities you tick here work only on agents you can see. +

diff --git a/admin/slices/user/user/components/user/create/Provider.vue b/admin/slices/user/user/components/user/create/Provider.vue index 683667334..47c7dc071 100644 --- a/admin/slices/user/user/components/user/create/Provider.vue +++ b/admin/slices/user/user/components/user/create/Provider.vue @@ -2,8 +2,21 @@ import type { ICreateUserData } from '#user/domain/user.types'; const userStore = useUserStore(); +const auth = useAuthStore(); const submitting = ref(false); +// The viewer's own row says whether their agent access is limited (RANCH-8): +// a limited Admin's new account reaches only what the Admin reaches, and the +// form says so before Create. Until the row is in, nothing is said; the API +// applies the rule either way. +const ceilingWarning = computed(() => userStore.isLimitedAdmin(auth.user)); + +onMounted(() => { + if (auth.user?.role === 'Admin') { + void userStore.fetchById(auth.user.id).catch(() => undefined); + } +}); + async function onSubmit(values: ICreateUserData) { submitting.value = true; const created = await userStore.create(values); @@ -27,6 +40,7 @@ function onCancel() { diff --git a/admin/slices/user/user/components/user/item/Form.vue b/admin/slices/user/user/components/user/item/Form.vue index 2a5e032c0..a58502304 100644 --- a/admin/slices/user/user/components/user/item/Form.vue +++ b/admin/slices/user/user/components/user/item/Form.vue @@ -1,4 +1,5 @@