← Console · หน้าหลัก
Console/ Planning/ Document Access Model
Share spec →

Document Access Model

User profiles with email · group-level + document-level visibility · stakeholder tags · bilingual labels · honest SCAFFOLD — no auth backend · โปรไฟล์ผู้ใช้ด้วยอีเมล · การมองเห็นระดับกลุ่มและเอกสาร · แท็ก stakeholder · สองภาษา · โครงร่างเท่านั้น — ยังไม่มี backend
Model · แบบจำลอง Live · scaffold Batch 7 · v1.0 Planning · แผน Draft A-owned No auth backend

User panel · โปรไฟล์ผู้ใช้ สร้าง/เลือก user profile ในเครื่องนี้เพื่อทดสอบ visibility

Overview · ภาพรวม

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

Key Point · ประเด็นสำคัญ

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

Summary · สรุป

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 ใช้ภาษาภาพแบบเดียวกับตัวกรองด้านบน

Access model · โมเดลสิทธิ์

Full spec: assets/access/document_access_schema.json

FieldTypePurpose / วัตถุประสงค์
emailstringPrimary identity · อัตลักษณ์หลัก · case-insensitive
display_namestring?Shown in header · หากไม่ระบุใช้ local-part ของอีเมล
roleenumviewer · editor · reviewer · admin · governance · external (informational only · เป็นข้อมูลอ้างอิงเท่านั้น)
visible_groupsarrayAllow list of groups · รายการกลุ่มที่อนุญาต
hidden_groupsarrayDeny list of groups (wins) · รายการปฏิเสธระดับกลุ่ม (ชนะ)
visible_documentsarray?Allow list of documents · รายการเอกสารที่อนุญาต
hidden_documentsarrayDeny list of documents (wins) · รายการปฏิเสธระดับเอกสาร (ชนะ)
restricted_documentsarrayMasked preview · การ์ดเห็น · เนื้อหาปิดพร้อม banner
preferred_languageth/en/bothReading language · ภาษาอ่าน
stakeholder_tagsarrayDrives 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

Visibility states · สถานะการมองเห็น

IDLabel · ป้ายMeaning · ความหมาย
visibleVisible · เห็นUser sees card and content · เห็นการ์ดและเนื้อหา
restrictedRestricted · ถูกจำกัดCard visible · content masked with banner · การ์ดเห็น · เนื้อหาปิดพร้อม banner
hidden-docHidden (document) · ซ่อน (เอกสาร)Card not rendered · deep link shows hidden banner · การ์ดไม่แสดง · ลิงก์ตรงเห็น banner
hidden-groupHidden (group) · ซ่อน (กลุ่ม)Whole group hidden · group button removed from main nav · ซ่อนทั้งกลุ่ม
not-grantedNot granted · ไม่ได้รับสิทธิ์Explicit deny · overrides allow lists · ปฏิเสธอย่างชัดเจน

User demo · ทดลองสิทธิ์

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 ด้านล่างอัปเดต

Live access summary · สรุปสิทธิ์ปัจจุบัน

Stakeholder filter · ตัวกรองผู้มีส่วนได้ส่วนเสีย

Click chips to toggle. Multi-select. Same visual pattern as the top filters. Items with matching tags remain visible; others are hidden.
คลิกชิปเพื่อสลับสถานะ · เลือกได้หลายรายการ · ใช้รูปแบบเดียวกับตัวกรองด้านบน · รายการที่มีแท็กตรงกันจะเห็น · ที่เหลือจะซ่อน

Stakeholder · ผู้มีส่วนได้ส่วนเสีย

Example filterable items · รายการตัวอย่าง

For exec / sales · ผู้บริหาร · ฝ่ายขาย

Executive brief · one-pager · deck copy.

For dev / product · นักพัฒนา · ผลิตภัณฑ์

Technical spec · API contract · schema.

For governance · กำกับดูแล

PDPA notes · approval matrix · audit trail.

For operations · ปฏิบัติการ

Runbook · on-call rotation · alert routing.

For external partners · พันธมิตร

Preview · public-safe summary.

Bilingual label dictionary · พจนานุกรมสองภาษา

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

Honest limits · ข้อจำกัดจริง

  • No authentication backend. Client can edit identity by hand. · ไม่มี backend ยืนยันตัวตน · แก้ identity ได้เอง
  • No password. No session validation. · ไม่มี password · ไม่มีการตรวจสอบ session
  • No server-side visibility enforcement. · ไม่มีการบังคับฝั่ง server
  • Role field is informational only. · role เป็นข้อมูลอ้างอิง
  • Profiles are browser-local. No cross-device sync. · profile อยู่เฉพาะเบราว์เซอร์นี้
  • Visibility decisions not audited. · ยังไม่มี audit log

Checklist · รายการตรวจสอบต่อ

  • ☐ Real authentication (OAuth/SSO) — Batch 8+ · ยืนยันตัวตนจริง
  • ☐ Server-side policy enforcement · บังคับใช้นโยบายฝั่ง server
  • ☐ Audit trail of visibility decisions · audit log
  • ☐ Policy inheritance / wildcards · การสืบทอดนโยบาย
  • ☐ Row-level redaction · ซ่อนบางฟิลด์ในเอกสาร
  • ☐ Password/passkey support · รองรับรหัสผ่าน/passkey

Change log · ประวัติการแก้ไข

DateChange · รายการ
2026-04-20v1.0 · initial scaffold · Batch 7

Access · สิทธิ์การเข้าถึง

Notes · Requirements · โน้ต/ความต้องการ

Honest state / สถานะจริง: localStorage only · browser-scoped · not synced · ยังอยู่ใน localStorage · เก็บเฉพาะเบราว์เซอร์นี้ · ยังไม่ sync