Repository navigation
Conversation
…sions - Add entity-based permission system via ResourceMember with entity_type + entity_id - Implement knowledge share service with batch_add_members, add_member, remove_member, update_member_role, and list_members - Refactor _add_initial_kb_members to use batch_add_members for single-transaction safety - Relax InitialMemberCreate.entity_type from Literal[\"user\", \"namespace\"] to str to support custom entity types (e.g., org_department) via registerAuthSection - Fix summary counts: deduplicate total_count and include shared_into_group_kbs in group_count - Frontend: use backend summary data for sidebar counts (total, personal, group, organization) - Frontend: hide \"from\" column in all/groups list views, show only in specific group view - Fix hidden invalid character (U+00B7) in PermissionManagementTab.tsx import - Add comprehensive tests for batch_add_members and initial KB member creation Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ternal DB specs - Make entity_id and entity_display_name NOT NULL with empty default - Keep user_id as NOT NULL DEFAULT 0 instead of nullable - Rename unique constraints to uniq_ prefix - Sync _sync_user_id_from_entity to use 0 for non-user entities - Update related test assertions Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (81)
📝 WalkthroughWalkthroughIntroduces polymorphic entity-based permissions across backend and frontend: database/schema migration, resolver framework, refactored share/knowledge services, group search, permission-source reporting, initial KB members, and comprehensive UI for managing user/namespace permissions, alongside extensive test and documentation updates. ChangesBackend polymorphic membership and share infrastructure
Knowledge service/group search and KB initial members
Backend adapters/readers/services switch to entity fields
Frontend APIs, types, i18n, and share-source utils
Permissions UI: registries, tabs, and AddNamespace dialog
Knowledge pages, sidebar, URL sync, and lists
Test updates and new suites for entity permissions
Docs and references for entity permission extension
Miscellaneous fixes and utilities
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant ShareAPI
participant UnifiedShareService
participant Resolver as ExternalResolver
participant DB
Client->>ShareAPI: POST /share/members {entity_type, entity_id, role}
ShareAPI->>UnifiedShareService: add_member(resource_id, entity_type, entity_id, role)
UnifiedShareService->>DB: upsert ResourceMember by (entity_type, entity_id)
alt entity_type != "user"
UnifiedShareService->>Resolver: get_display_name/batch names
Resolver-->>UnifiedShareService: display names (optional)
end
UnifiedShareService-->>Client: ResourceMemberResponse {display_name, source_type}
Client->>ShareAPI: GET /KnowledgeBase/{id}/my-permission-sources
ShareAPI->>UnifiedShareService: get_my_permission_sources(id, user_id)
UnifiedShareService->>DB: fetch direct user and entity members
UnifiedShareService->>Resolver: match_entity_bindings(user_id, entity_ids)
Resolver-->>UnifiedShareService: matched entity_ids
UnifiedShareService-->>Client: {role, sources[]}
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
|
Summary by CodeRabbit
New Features
Documentation