Skip to main content

pack-local-utility pattern

PermissionExplainer

Explain a browser, file, download, or site permission before requesting it.

pack/local-utility · candidate · @sanchika/patterns

Product job

Understand a permission's purpose, scope, affected data, denial behavior, and fallback before deciding.

Explain a browser, file, download, or site permission before requesting it.

Anatomy and required fields

permission

Specific capability being requested.

purpose

Why the workflow needs it.

scope

Where and for how long it applies.

dataTouched

Data or browser capability the permission can access.

dataNotTouched

Data or locations outside the permission scope.

denialBehavior

What happens when permission is denied.

sourcePolicy

Inspectable source or policy link.

fallback

Manual or reduced-capability path.

requestAction

Permission request control.

Required fields
  • permission
  • purpose
  • scope
  • dataTouched
  • dataNotTouched
  • denialBehavior
  • sourcePolicy
  • fallback
  • requestAction

Default and edge states

required

Permission is needed.

  • permission required
  • purpose
  • fallback
optional

The workflow can continue without the permission.

  • optional
  • reduced capability
  • continue action
granted

Permission is available.

  • granted
  • scope
  • revoke path
denied

Permission is unavailable.

  • denied
  • effect
  • manual path
unavailable

The browser cannot offer the permission.

  • unavailable
  • reason
  • manual path
not-requested

No permission request has occurred.

  • not requested
  • purpose
  • review action

Composed synthetic exemplar

State coverage

Default and consequential edges remain inspectable.

requiredPermission is needed.permission required · purpose
optionalThe workflow can continue without the permission.optional · reduced capability
grantedPermission is available.granted · scope
deniedPermission is unavailable.denied · effect
unavailableThe browser cannot offer the permission.unavailable · reason
not requestedNo permission request has occurred.not requested · purpose

Trust, source, and consumer obligations

Trust boundaries
  • Credentials and portal session remain with the government portal and the user's browser.
  • Name any network request, permission, artifact destination, and telemetry behavior before the action.
Consumer owns
  • Prove portal behavior, permissions, network requests, downloads, telemetry, release evidence, and every custody statement.
Responsive behavior
  • Keep permission, purpose, and fallback before the request control.
  • Do not hide scope inside hover-only help.
Forced colors and reduced motion
  • Retain numbered order, text labels, link underlines, focus, and custody boundaries with system colors.
  • Preserve custody order, permission scope, denial behavior, and local destination without animated connectors.

Compact API reference

Package
@sanchika/patterns
CSS
@sanchika/patterns/styles.css
Base class
sk-pattern-permission-explainer
Group
pack-local-utility