
Summary
Key points of this document
- Where are the design challenges?
- How to define boundaries?
- Details that matter in implementation.
Overview
A document management system cannot be established merely by being able to place files. It is necessary to first design who can view, who can edit, and what can be done after the status changes. Document management permissions are not settings hidden on the screen, but a data model that consistently applies to search, preview, download, sharing, and deletion.
Where are the design challenges?
In document management, the scope of operations available to the same user changes depending on the document type and status. If viewing, registration, editing, approval, rejection, and deletion are handled only with a simple administrator flag, exceptions will increase after operations begin.
Due to organizational changes and personnel changes, granting permissions on an individual basis alone makes maintenance difficult. On the other hand, relying solely on department-level permissions can make it difficult to accommodate temporary assignments or audit roles.
In document management, information is contained not only in the file itself but also in its title, thumbnail, search results, and update history. It is not enough that files without viewing permission cannot be opened; sometimes, the mere visibility of their existence in lists or search results can be a problem.
How to define boundaries?
The authorization model is considered as a combination of user, affiliation, role, document type, document status, and operation. First, define broad roles, and then treat only necessary exceptions as additional permissions. Making state transitions and operation permissions visible in the same table facilitates review.
In design, we separate owner, organization, folder inheritance, individual sharing, and roles. Permission determination is implemented not as if-statements for each screen, but as a common service for API and search, in a way that can explain why something was permitted or denied.
Details that matter in implementation.
In the DB, we separate document body, document type, status history, permission grants, and audit logs. The API performs permission checks for each operation, and the React screen displays only the possible operations. Approved documents are not updated directly; instead, a new version is created.
In PostgreSQL, we separate documents, folders, memberships, document, acl, permission, and events. Since recursively resolving ACLs every time can be heavy, caching effective_permissions with expanded inheritance and updating them via change events is also an option.*Do not group viewing, editing, sharing, deletion, and downloading as the same permission.*Include permission scope in search metadata and filter during search.
- Record permission changes in audit logs to track who granted what permissions to whom.
- Observe how it breaks.
- In verification, we check cases such as out-of-department viewing, post-approval editing, deletion permissions, access by resigned employees, and proxy assignments. Converting the permission matrix into test data makes it easier to find omissions during specification changes.
In verification, we separately check direct URL access, search results, preview, download, and shared links. We also test whether content remains in search results immediately after permissions are removed, and for cache or index delays.
Discarded options and trade-offs.
Making permissions too granular complicates the administration screen. It is more realistic to first strictly control high-risk operations and prioritize designing viewing ranges and approval operations.
Granular permissions offer flexibility but can be difficult for users to understand. Over-simplification leads to an increase in exceptional operations. A design where permissions are held granularly internally but presented as representative permission sets on the screen is easier to manage.
Decision criteria to leave on site.
The quality of document management is not determined solely by search and upload functions. By designing permissions and state transitions first, it becomes easier to withstand subsequent audits and organizational changes.
Document management permission design becomes more difficult the later it is added. By first deciding on the scope of judgment and explainability, it becomes easier to maintain security even as search and sharing increase.
The quality of document management is not determined solely by search and upload functions. By designing permissions and state transitions first, it becomes easier to withstand subsequent audits and organizational changes.
Document management permission design becomes more difficult the later it is added. By first deciding on the scope of judgment and explainability, it becomes easier to maintain security even as search and sharing increase.


