Renders a US-Government-style classification banner above the room header in ABAC-managed rooms, driven by a JSON
configuration stored in the ABAC_Classification_Banners_Config admin setting
(Admin → ABAC → Settings), toggled by ABAC_Classification_Banners_Enabled.
The configuration is a public setting: it syncs to every logged-in client, and the banner is computed
client-side from the room's abacAttributes and the configuration. Config or room-attribute changes
propagate to open clients live, with no reload. Note the visibility tradeoff: any logged-in user can read the full
configuration (all source keys and value→label/color mappings), so don't encode anything in it that members
shouldn't see.
Configuration schema
Version 1 of the configuration is described by the JSON Schema with
$id: https://rocket.chat/schemas/classification-banners/v1.json
(published in the Rocket.Chat repository at ee/packages/abac/docs/classification-banners.schema.json).
This builder generates and validates documents against that contract.
Semantics
-
Segments — one per attribute with
showInBanner: true, in array order, joined by
banner.delimiter. An attribute contributes a segment when the room has at least one value for the
room attribute whose key equals attributes[].source. Values matching a values[].source
entry render as their mapped label; unmapped values render as the raw value.
-
Segment text — value labels (mapped label, or raw value when unmapped) joined by
valueSeparator;
unmapped values always come after the mapped ones. With
showLabel: true the segment is prefixed with bannerLabel + labelSeparator. With
sortAlpha: true labels are sorted alphabetically. When groupThreshold > 0 and the
matched value count reaches the threshold, the value list collapses to multipleLabel.
-
Color — the single attribute with
drivesColor: true picks the banner background. Its
values array is ranked most restrictive first — index 0 = highest ranking (same convention
as Virtru HIERARCHY attributes). colorMode: "highest" selects the highest-ranked matched
value (earliest in the array); "attribute" selects the first of the room's values that is mapped.
The foreground color is computed for readable contrast (WCAG relative luminance). If the driver attribute has
no matched values, banner.fallbackColor is used. Unmapped values never drive color.
-
Fallback — when no attribute produces a segment, the banner renders
banner.fallbackText on
banner.fallbackColor.
-
Styles (
banner.style) — classic: single centered line; segmented:
segments separated by vertical rules instead of the delimiter; edge: classic with contrasting
top/bottom edge rules.
- The banner always renders above the room header.
- Config changes require no server restart and propagate to open clients live via settings sync.
Cross-field rules
These rules are part of the v1 contract and are validated by this builder (save-time enforcement in Rocket.Chat ships separately):
- Exactly one attribute has
drivesColor: true.
attributes[].id values are unique; within an attribute, values[].source are unique.
multipleLabel is required when groupThreshold > 0.
bannerLabel is required when showLabel: true.
Example
The bundled example reproduces the design prototype's default state. For a room with
clearance.level = [TS], access.programs = [SAP-1042, SAP-2271, SAP-3380],
dissem.relto = [USA] it renders TOP SECRET // SAR-APPLES/BANANAS/ORANGES // RELTO USA on
the Top Secret orange. Use Load example to open it in the builder and copy its JSON.