release: v3.3.24 – develop → staging#855
Conversation
…e and update methods
… tenant admin checks
…o featureRoleMap
…otification and organization controllers
…nsertion; improve organization feature mappings.
…n-derived parameters
…codes in header and footer retrieval
enhance: email template functions to include tenant and organization in header and footer
… and updated_by fields
…redundancy in organization feature access checks.
…mline role handling
…nization features to empty set when no role mappings are found
feat: add database connection pool and timeout configurations
organization miss fix
add(role): migration to create tenant_admin role and assign permissions
feat: implement feature-role mapping
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughIntroduces tenant admin role capabilities and feature-role mapping infrastructure. Adds Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant AdminCtrl as Admin Controller
participant AdminSvc as Admin Service
participant UserQuery as User Queries
participant OrgQuery as Organization Queries
participant RoleQuery as Role Queries
participant RoleMapQuery as Role-Mapping Queries
participant EventBus as Event Bus
participant Redis
participant DB
Client->>AdminCtrl: assignRole(req)
AdminCtrl->>AdminCtrl: Validate ADMIN_ROLE
AdminCtrl->>AdminSvc: assignRole(params, body)
rect rgb(200, 220, 240)
Note over AdminSvc: Validation Phase
AdminSvc->>UserQuery: Find user by id
UserQuery->>DB: Query user record
DB-->>UserQuery: User found
UserQuery-->>AdminSvc: User data
AdminSvc->>OrgQuery: Verify org association
OrgQuery->>DB: Query user.organizations
DB-->>OrgQuery: Org list
OrgQuery-->>AdminSvc: Org verified
AdminSvc->>RoleQuery: Check role exists
RoleQuery->>DB: Query role
DB-->>RoleQuery: Role found/not found
end
rect rgb(220, 240, 200)
Note over AdminSvc: Creation Phase
AdminSvc->>RoleMapQuery: Create role mapping
RoleMapQuery->>DB: Insert user_role record
DB-->>RoleMapQuery: Mapping created (or constraint error)
end
rect rgb(240, 220, 200)
Note over AdminSvc: Post-Assignment Cleanup
AdminSvc->>UserQuery: Fetch updated user
AdminSvc->>EventBus: Broadcast user update event
EventBus-->>AdminSvc: Event sent
AdminSvc->>Redis: Clear user cache
Redis-->>AdminSvc: Cache cleared
AdminSvc->>DB: End user sessions for tenant
DB-->>AdminSvc: Sessions ended
end
AdminSvc-->>AdminCtrl: Success response
AdminCtrl-->>Client: HTTP response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Possibly related PRs
Poem
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai summary |
✅ Actions performedSummary regeneration triggered. |
fix: improve error handling in database initialization and seeding
feat(admin): add assignRole method for validating user and role IDs
Summary by CodeRabbit
Release Notes
New Features
Enhancements