This document defines the user/access/visibility layer for Thailand-Together console documents. It introduces a lightweight profile model backed by localStorage, visibility rules at group and document level, bilingual labels, a stakeholder filter, and explicit honesty about what is NOT backed by a server.
เอกสารนี้กำหนดชั้น user/access/visibility ของเอกสารภายใต้ console · ใช้ profile ที่เก็บใน localStorage · มีกฎ visibility ทั้งระดับกลุ่มและเอกสาร · มี label สองภาษา · มีตัวกรอง stakeholder · และระบุข้อจำกัดจริงชัดเจนว่ายังไม่มี server backend
Every document can be hidden, restricted, or allowed per user · per group · per doc — entirely in the browser for now.
เอกสารแต่ละหน้าสามารถถูกซ่อน · จำกัด · หรืออนุญาต ต่อผู้ใช้ · ต่อกลุ่ม · ต่อเอกสาร — ทั้งหมดอยู่ในเบราว์เซอร์ ณ ขั้นนี้
SCAFFOLD · NO AUTH BACKEND · editable via localStorage.
โครงร่าง · ไม่มี auth backend · แก้ได้ผ่าน localStorage
The model introduces a 12-field user profile, 5 visibility states (visible · restricted · hidden-doc · hidden-group · not-granted), and a resolution algorithm that combines group and document policies with an explicit precedence order. Bilingual labels live in a central dictionary consumed by the shell. A stakeholder filter pattern mirrors the top-filter visual language already in use.
โมเดลประกอบด้วย user profile 12 ฟิลด์ · สถานะ visibility 5 แบบ · อัลกอริทึม resolution ที่รวม policy ของกลุ่มและเอกสารตามลำดับ precedence ที่ชัดเจน · ป้ายสองภาษาเก็บในพจนานุกรมกลางที่ shell ใช้ร่วม · ตัวกรอง stakeholder ใช้ภาษาภาพแบบเดียวกับตัวกรองด้านบน
Full spec: assets/access/document_access_schema.json
| Field | Type | Purpose / วัตถุประสงค์ |
|---|---|---|
email | string | Primary identity · อัตลักษณ์หลัก · case-insensitive |
display_name | string? | Shown in header · หากไม่ระบุใช้ local-part ของอีเมล |
role | enum | viewer · editor · reviewer · admin · governance · external (informational only · เป็นข้อมูลอ้างอิงเท่านั้น) |
visible_groups | array | Allow list of groups · รายการกลุ่มที่อนุญาต |
hidden_groups | array | Deny list of groups (wins) · รายการปฏิเสธระดับกลุ่ม (ชนะ) |
visible_documents | array? | Allow list of documents · รายการเอกสารที่อนุญาต |
hidden_documents | array | Deny list of documents (wins) · รายการปฏิเสธระดับเอกสาร (ชนะ) |
restricted_documents | array | Masked preview · การ์ดเห็น · เนื้อหาปิดพร้อม banner |
preferred_language | th/en/both | Reading language · ภาษาอ่าน |
stakeholder_tags | array | Drives default state of Stakeholder filter · กำหนดสถานะเริ่มต้นของตัวกรอง stakeholder |
Resolution precedence: hidden_groups > hidden_documents > restricted_documents > visible_documents > visible_groups.
ลำดับ: hidden_groups > hidden_documents > restricted_documents > visible_documents > visible_groups
| ID | Label · ป้าย | Meaning · ความหมาย |
|---|---|---|
visible | Visible · เห็น | User sees card and content · เห็นการ์ดและเนื้อหา |
restricted | Restricted · ถูกจำกัด | Card visible · content masked with banner · การ์ดเห็น · เนื้อหาปิดพร้อม banner |
hidden-doc | Hidden (document) · ซ่อน (เอกสาร) | Card not rendered · deep link shows hidden banner · การ์ดไม่แสดง · ลิงก์ตรงเห็น banner |
hidden-group | Hidden (group) · ซ่อน (กลุ่ม) | Whole group hidden · group button removed from main nav · ซ่อนทั้งกลุ่ม |
not-granted | Not granted · ไม่ได้รับสิทธิ์ | Explicit deny · overrides allow lists · ปฏิเสธอย่างชัดเจน |
The user panel above creates, switches, and forgets browser-local profiles. Pick a profile and observe the Access panel update below.
User panel ด้านบนสร้าง/เลือก/ลบ profile ในเบราว์เซอร์ · เลือกแล้วดู Access panel ด้านล่างอัปเดต
Click chips to toggle. Multi-select. Same visual pattern as the top filters. Items with matching tags remain visible; others are hidden.
คลิกชิปเพื่อสลับสถานะ · เลือกได้หลายรายการ · ใช้รูปแบบเดียวกับตัวกรองด้านบน · รายการที่มีแท็กตรงกันจะเห็น · ที่เหลือจะซ่อน
Executive brief · one-pager · deck copy.
Technical spec · API contract · schema.
PDPA notes · approval matrix · audit trail.
Runbook · on-call rotation · alert routing.
Preview · public-safe summary.
A central dictionary at assets/i18n/label_dictionary.json covers: group names · shell section labels · modes · note statuses/types · action labels · filter labels · stakeholder labels · share-support labels · access labels. The shell uses the ds.t(key) helper with a 3-state language toggle (both / th / en) remembered in localStorage[ds.lang].
พจนานุกรมกลางครอบคลุมชื่อกลุ่ม · ชื่อ section · โหมด · สถานะ/ประเภทโน้ต · ป้ายปุ่มการทำงาน · ป้ายตัวกรอง · ป้าย stakeholder · ป้ายสถานะแชร์ · ป้ายสิทธิ์ · shell ใช้ helper ds.t(key) พร้อมปุ่มสลับภาษา 3 สถานะ (ทั้งคู่ / ไทย / อังกฤษ) ที่จำไว้ใน localStorage
| Date | Change · รายการ |
|---|---|
| 2026-04-20 | v1.0 · initial scaffold · Batch 7 |
Full spec: document-share-export.html