Ho Ngoc Hai
2d738aeefa
feat(enforcement): add MediatR permission authorization behavior
Phase 2 of permission management — enforcement in MerchantService:
- PermissionConstants: maps JWT "permission" claim strings to
StaffPermissions bitmask via FromClaims() method
- IRequirePermission: marker interface for commands needing permission
check (StaffPermissions RequiredPermission property)
- PermissionAuthorizationBehavior: MediatR pipeline behavior that reads
permission claims from HttpContext.User, converts to bitmask, validates
against IRequirePermission.RequiredPermission. Skips non-annotated commands.
- Registered in MediatR pipeline after Validator, before Transaction
- Annotated 3 staff commands with ManageStaff permission:
InviteStaffCommand, CreateActiveStaffCommand, UpdateStaffCommand
- Added HttpContextAccessor DI registration
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 06:47:01 +07:00
..
2026-03-23 10:09:45 +07:00
2026-02-23 11:25:27 +00:00
2026-03-23 09:48:22 +07:00
2026-03-25 15:00:05 +07:00
2026-03-23 09:48:22 +07:00
2026-03-25 15:00:05 +07:00
2026-03-25 15:00:05 +07:00
2026-03-23 09:48:22 +07:00
2026-03-23 09:48:22 +07:00
2026-03-23 09:47:07 +07:00
2026-03-23 09:48:22 +07:00
2026-03-25 15:00:05 +07:00
2026-03-25 19:50:06 +07:00
2026-03-23 09:48:22 +07:00
2026-03-23 09:54:59 +07:00
2026-03-26 06:47:01 +07:00
2026-03-23 09:47:07 +07:00
2026-03-23 09:48:22 +07:00
2026-03-25 15:00:05 +07:00
2026-03-25 15:00:05 +07:00
2026-03-25 15:00:05 +07:00
2026-03-25 15:00:05 +07:00
2026-03-23 10:09:45 +07:00
2026-03-23 09:52:20 +07:00
2026-03-23 09:48:22 +07:00
2026-03-23 09:54:59 +07:00
2026-03-23 09:48:22 +07:00