2.7 KiB
2.7 KiB
Plan: User Creation, Login, and Access Testing
🎯 Objective
Verify that the RBAC system correctly restricts user creation based on account types and ensures that new users can successfully log in and access their respective dashboards.
🏗️ Technical Approach
The testing will be conducted using the browser tool to simulate real user interactions. We will iterate through each user type, perform creation attempts (both valid and invalid), and verify the results.
1. Test Data Setup
We need a set of "Parent" users for each type. I will verify if these exist or create them via the database if needed.
ULTIMATE:admin(assuming exists)SUPER_OPERATOR:test_super_opOPERATOR:test_opCOORDINATOR:test_coordSTORE_OWNER:test_store_ownerUSER:test_user
2. Creation Permission Matrix (Target vs Actor)
| Actor \ Target | ULTIMATE | SUPER_OP | OPERATOR | COORD | SUPPLIER_O | WHOLESALE | SUPPLIER | STORE_OWNER | STORE_MGR | USER | RIDER | POS_T |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ULTIMATE | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| SUPER_OP | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| OPERATOR | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ |
| COORD | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ✅ | ❌ | ✅ | ❌ |
| STORE_OWNER | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ✅ | ✅ |
| USER | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
3. Verification Steps
- Login as the Actor user.
- Navigate to the "Create User" page.
- Check the "User Type" dropdown for allowed options.
- Attempt to create an allowed user type:
- Fill form with valid data.
- Submit.
- Verify "Success" message.
- Attempt to create a restricted user type (if UI allows selection or via direct API manipulation if possible, but primarily UI-based check).
- Login as the newly created user to verify account activation.
- Logout and repeat for next role.
🛠️ Tools & Commands
- Browser: Interaction and visual verification.
- Tinker: Quick user creation for testing setup if needed.
- Docker: Build and restart after any potential fixes (though this task is primarily testing).
📅 Timeline
- Phase 1: Environment Readiness (Verify/Create Actor Users)
- Phase 2: Browser Testing - ULTIMATE & SUPER_OPERATOR
- Phase 3: Browser Testing - OPERATOR & COORDINATOR
- Phase 4: Browser Testing - STORE_OWNER & USER (Restriction check)
- Phase 5: Final Report and Cleanup