Draft
Add support for multi-user management with data isolation#2818
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… and API Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
…h bcrypt Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Copilot stopped work on behalf of
whyour due to an error
November 7, 2025 16:38
Owner
|
@copilot 继续执行 |
…ions Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Contributor
Author
Copilot
AI
changed the title
[WIP] Add support for multi-user management with data isolation
Add support for multi-user management with data isolation
Nov 9, 2025
Owner
继续执行 |
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Contributor
Author
7539d75 to
e8ac195
Compare
f43efe3 to
7933fe0
Compare
2f7b6e3 to
06fc588
Compare
39058bb to
23a1835
Compare
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.
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #2769
The current system uses single-user authentication with a shared database. All users share the same data without any isolation, making it unsuitable for multi-tenant scenarios.
What is the new behavior?
This PR implements comprehensive multi-user management with complete data isolation:
Backend Implementation (Complete)
User Management:
Data Isolation:
Services Updated:
Log Management:
Security Features:
API Endpoints:
GET /api/user-management- List all users (admin only)POST /api/user-management- Create new user (admin only)PUT /api/user-management- Update user (admin only)DELETE /api/user-management- Delete users (admin only)GET /api/user/login-log- View login logs (admin only)GET /api/system/log- View system logs (admin only)DELETE /api/system/log- Delete system logs (admin only)Frontend Implementation (Complete)
User Management Interface:
Role-Based UI Visibility:
Features:
Data Migration Tools (Complete)
Migration Script:
migrate-to-multiuser.js- Automated Node.js migration scriptMigration Usage:
Documentation (Complete)
MULTI_USER_GUIDE.md:
MIGRATION_GUIDE.md:
Database Migration
db.tsto add userId columns to existing tablesDoes this PR introduce a breaking change?
The implementation is fully backward compatible. The original system admin account continues to work, and existing data (without userId) remains accessible to all users as legacy data until migrated.
Other information
Technical Details:
Testing:
Migration Path:
Existing installations can upgrade seamlessly. All existing data becomes "legacy data" accessible by all users until explicitly assigned to specific users using the provided migration script (
migrate-to-multiuser.js).Implementation Status:
Files Changed:
Script and Config Management:
Scripts and configuration files remain shared by default (suitable for collaborative environments). User-level isolation can be implemented if needed by creating per-user directories and updating the relevant APIs.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.