Skip to content

manifest: add access_policies key and guided access-policies command - #307

Merged
mihilmy merged 2 commits into
mainfrom
access-policies
Aug 4, 2026
Merged

manifest: add access_policies key and guided access-policies command#307
mihilmy merged 2 commits into
mainfrom
access-policies

Conversation

@mihilmy

@mihilmy mihilmy commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

access_policies is a JSON array of allow/deny statements that supersedes disabled_features — same off-switch, plus a resource that scopes a rule to documents matching a Purview sensitivity label. This adds the config key with structural validation, documents it in manifest.md, and adds a guided /access-policies command that walks the admin from label GUIDs to a finished array.

   ┌─ statement ──────────────────────┐
   │ effect: deny | allow             │
   │ action: <slug> | [<slug>, …]     │   slugs: addin.access · file.upload
   │ resource? ──▶ { type,            │          skills.authoring · thumbs
   │   identifiers: [ mip_label_guid  │
   │                  (equals|exists) │
   │                | mip_label_name  │
   │                  (equals|startsWith|endsWith|exists) ] }
   └──────────────────────────────────┘
     no resource  = disabled_features (off for everyone)
     resource     = scoped to labelled documents

   /access-policies (guided)            build-manifest.mjs
   1. Get-Label → GUIDs         ──▶     • invalid JSON        → fatal
   2. pick statement shapes             • bad effect / type   → warn
   3. explain matching rules            • wrong op for type   → warn
   4. read back + validate              • blank slug, empty identifiers → warn

The validator warns on exactly the shapes the add-in drops silently at runtime, so the build is the only place they're caught. Docs also gain a grammar reference + slug tables (access-policies.md, manifest.md) and the missing access_policies field in bootstrap.md.

Test plan

  • node build-manifest.mjs office out.xml … access_policies='[…]' → value baked into the taskpane URL, URL-encoded; valid statements produce no warnings.
  • Probes, each producing a targeted warn: naming the statement/identifier: guid + startsWith; equals: ""; empty identifiers; blank action slug; non-string description; bad effect/type; two operators; top-level object. Invalid JSON → exit 1.
  • python3 scripts/check.py → 0 issues.

mihilmy added 2 commits August 3, 2026 18:49
Adds the access_policies config key — a JSON array of allow/deny
statements that supersedes disabled_features and can scope a rule to
documents by Purview sensitivity label. The build script recognizes
the key (warn-only shape check for a JSON array), manifest.md documents
it alongside disabled_features, and a new access-policies command walks
the admin through fetching label GUIDs, choosing statements, and the
matching rules to explain before shipping.
The build script now parses access_policies and warns on each statement
that fails the grammar — bad effect, unknown resource or identifier type,
an operator the identifier type does not support (a GUID takes only
equals | exists), an empty identifiers array, a blank action slug. These
are the shapes the add-in drops silently, so the build is the only place
they get caught; an unparseable value is fatal.

Docs: add a statement-grammar reference and the full feature-slug list to
access-policies.md, sync the disabled_features table in manifest.md with
all four slugs, add the missing access_policies field to bootstrap.md,
and fix the parent-label prefix example to include the " - " separator.
@mihilmy
mihilmy merged commit 3865222 into main Aug 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants