Repository navigation
docs(permission): add permission model guide in fumadocs format - #399
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Document permission model for ObjectStack
docs(permission): add comprehensive permission model guide
Jan 30, 2026
Contributor
|
@copilot 文档应该按fumadocs规范,全部英文,放在合适的文件夹位置,需要考虑菜单 |
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Contributor
Author
Copilot
AI
changed the title
docs(permission): add comprehensive permission model guide
docs(permission): add permission model guide in fumadocs format
Jan 30, 2026
hotlong
marked this pull request as ready for review
January 30, 2026 15:53
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive documentation for ObjectStack's three-layer access control architecture in Fumadocs MDX format. The documentation explains the interaction between RLS (database-level), Permissions (application CRUD), and Sharing (business rules) with the precedence formula Final Access = RLS ∩ Permission ∩ Sharing.
Changes:
- Documents complete permission model with practical examples from multi-tenant sales organizations
- Provides test case matrices demonstrating precedence behavior across layers
- Includes migration guidance from RBAC and Salesforce permission models
- Adds performance optimization and security best practices sections
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| content/docs/objectos/permission-model.mdx | Comprehensive 526-line permission model documentation with examples, test cases, schema references, and implementation guidance following Fumadocs format |
| content/docs/objectos/meta.json | Adds "permission-model" to ObjectOS documentation navigation |
This was referenced Oct 26, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents ObjectStack's three-layer access control architecture: RLS (database-level), Permissions (application CRUD), and Sharing (business rules). Clarifies precedence semantics (
Final Access = RLS ∩ Permission ∩ Sharing) and evaluation flow.Location
content/docs/objectos/permission-model.mdxContent
Core Model (Layers 1-3)
using/checkclauses, role-based policiesPractical Guidance
Technical Details
Schema References
Links to canonical implementations:
permission/permission.zod.ts- PermissionSet, ObjectPermission, FieldPermissionpermission/rls.zod.ts- RowLevelSecurityPolicy with full PostgreSQL semanticspermission/sharing.zod.ts- CriteriaSharingRule, OwnerSharingRule, OWD enumspermission/territory.zod.ts- Territory model for matrix reporting structuresExample
Original prompt
Week 2: Security & Permission Model
Task 2.1: Document Permission Model 📖
文档化权限模型
Files: Create packages/spec/docs/PERMISSION_MODEL.md
Content:
ObjectStack Permission Model
ObjectStack 权限模型
Overview / 概览
ObjectStack 提供三层记录级访问控制:
Precedence Order / 优先级顺序
访问权限计算公式:
Final Access = RLS ∩ Permission ∩ Sharing
Most Restrictive Wins (最严格的规则获胜)
Evaluation Flow / 评估流程
RLS Policies (cannot bypass) ↓ PASS
Object Permissions (CRUD + VAMA) ↓ PASS
Sharing Rules (OWD + Criteria) ↓ PASS
GRANT ACCESS
Layer 1: Row-Level Security (RLS)
Purpose / 用途
PostgreSQL-inspired database-level policies that cannot be bypassed even by admins.
When to Use / 使用场景
Example / 示例