๐ฅ Users, Roles & Permissions
Users vs POS Staff (different identities)
Solvexa maintains two separate identity concepts:
- User (AppUser table): logs into the back-office web app. Owner, accountant, purchase manager.
- Staff (Staff table): logs into POS terminals with a 4-digit PIN. Cashiers, waiters.
Same person can be BOTH โ e.g. shop owner has a User login for finance + a Staff PIN for occasional cashier duty. Linked by UserID.
Add a new User (back-office login) โ different from POS Staff
Use this if you want someone to log into the back-office web app (owner, accountant, purchase manager, admin). For a cashier who only rings bills on the POS terminal, use "Add a POS Staff" below instead.
- Admin โ User Management โ + New User
- Fill: Login Name (e.g. rahul), Display Name, Email, Phone, Role (see below), Initial Password
- Optional: WhatsApp Phone + Opt-In โ lets user chat with Saathi via WA
- Optional: Secondary Role for combined permissions
- Click Save. User gets password reset link via email (SignupMailer). Must change password on first login.
Add a new POS Staff (cashier / waiter / kitchen)
Use this if you want someone to log into a POS terminal with a 4-digit PIN โ cashiers, waiters, KDS kitchen operators. This is a SEPARATE identity from a back-office User (see the "Users vs POS Staff" section above). The same person can have BOTH โ e.g. a store manager might be both a User (for reports) and a Staff (for occasional cashier duty).
- Admin โ Staff Management โ + New Staff
- Fill: Staff Code (short id, e.g. C01), First Name, Last Name, Role (POS-side role, e.g. Cashier / Manager)
- Go to the Security tab: set a Password (required for new staff) + optional POS PIN (4โ6 digits, used at the till)
- Go to the Store Access tab: pick which stores this staff can log into. Toggle Cashier / Manager / Default per store. Only the stores in the dropdown are your own tenant's stores.
- Go to the Permissions tab: uncheck any permission you want to deny (defaults come from the role).
- Click Save Staff. Staff can now log into POS terminals in the assigned stores using either the password OR the POS PIN.
Common confusion: if someone asks "how do I create a staff", they almost always mean this cashier flow (Admin โ Staff). If they need to log into the back-office web app instead, they need a User (Admin โ User Management, section above).
Fun fact: SolvexaRetail keeps User and Staff as two separate tables because the trust boundaries are very different โ a POS Staff PIN is a shared-device authenticator, a User password is a personal-device one.
Built-in Roles
| Role | What they can do |
|---|---|
| SYSADMIN | Everything. Only one per tenant (owner). Cannot be deactivated. |
| Admin | User management, settings, all modules. Can grant permissions. |
| Manager | Purchase, Sales, Inventory, Reports. Can post transactions. No user mgmt. |
| Accountant | Finance module. Post journals, run reports, reconcile bank. Read-only on Items/Vendors/Customers. |
| Cashier | POS only. No access to back-office. |
| Viewer | Read-only across all modules. For auditors, investors. |
Fine-grained per-user permissions
Roles set the default. Override per-user for specific overrides.
- Open a user โ Permissions tab
- List of all 200+ permissions grouped by module. Each has Allow / Deny / Inherit-from-role
- Common overrides: give a Cashier Report.SalesRegister.View to check own sales; deny a Manager Vendor.Edit to prevent unauthorized vendor changes
- Save. Takes effect on next login (session-cached).
Change password
- User self-service: click your name (top-right) โ Change Password
- Admin reset: User Management โ user โ Reset Password. New password emailed to user + forced change on next login.
- Forgot password: from Login screen โ Forgot Password? โ enter email โ reset link mailed
- Password strength: min 8 chars, ideally mix of case + digit + symbol. Bcrypt-hashed at rest.
Two-Factor Authentication (2FA)
Add a second lock: after password, prompt for a 6-digit code from Google Authenticator / Authy / 1Password.
- Enable: Account โ Security โ Enable 2FA
- Scan the QR code with your authenticator app
- Type the current 6-digit code to confirm
- Save 8 backup codes โ each works ONCE if you lose your phone. Store somewhere safe.
- Next login: password โ 2FA prompt โ in.
- Disable: Account โ Security โ Turn Off 2FA (requires current 6-digit code to disable โ prevents attacker from turning it off)
Lock or deactivate a user
- 5 wrong passwords โ auto-locked for 15 min (no admin action needed)
- Admin manual lock: User Management โ user โ toggle Active. Blocks login immediately.
- Delete a user: NOT possible after they've posted transactions. Instead, deactivate.
- Sessions kill: Admin โ Sessions โ tick user's active sessions โ Revoke. Forces re-login.
Login + activity audit
- Admin โ Sessions: who's logged in right now (IP, browser, since when)
- Admin โ LoginLog: last 30 days of login attempts (success/fail, IP)
- Admin โ AuditFeed: sensitive events โ POS Manager Override, Cost Change, Permission Grant. AI-narrated by Saathi.
- Failed login spikes = brute force attempt. IP auto-added to rate-limit block list.
Store-level scoping
Multi-store businesses: restrict a user to see only their store.
- Open user โ Allowed Stores tab
- Tick stores this user can access. Untick to hide.
- Save. User's default filter across all reports scoped to allowed stores.
- Manager overrides: still needs the permission (e.g. Store.Switch) to change stores at all.