👥 Users & Roles¶
The Users & Roles section allows you to manage your staff, assign them to branches, and strictly control what they can and cannot do in the ChouyLok system.
Managing Users¶
To manage your staff, navigate to 👥 Users (គណនីប្រើប្រាស់) in the sidebar.
Viewing Users¶
- Shop Owners & Admins: You will see all staff members in your workspace. You can click on any user to view their activity or edit their profile.
- Users are clearly labeled with their assigned role (e.g., MANAGER, CASHIER).
- If a user is deleted, they will appear crossed out with a red DELETED badge.
Creating a New User¶
To add a new staff member:
1. Click the Create New User (បង្កើតគណនីថ្មី) button. (Requires users.create permission).
2. Fill in their name, phone number, and a password (must be at least 6 characters).
3. Choose their branch. This is required: pick the branch where they work, or All branches (គ្រប់សាខា) for a manager who works everywhere, including branches you add later. If your shop has only one branch, it is already chosen.
4. Select a role for them from the dropdown list.
5. Click Save. The user can now log in using their phone number and password.
Resetting Passwords¶
If a staff member forgets their password, they can easily reset it using Telegram:
1. On the login screen, they can request an OTP to their registered phone number.
2. The OTP is sent via the @ChouyLokAuthBot on Telegram. (If they haven't linked their Telegram, the system will guide them to do so).
3. After entering the 6-digit OTP, they can set a new password securely.
Alternatively, Shop Owners and Admins can manually change a user's password directly from the user's profile page.
Managing Roles & Permissions¶
To manage roles, navigate to 🛡️ Roles (សិទ្ធិប្រើប្រាស់) in the sidebar.
Roles let you define custom sets of permissions (e.g., "Cashier", "Stock Manager") so you don't have to assign permissions one by one to each user.
Understanding Roles¶
- Ownership and platform access: these belong to the account, rather than a
custom role name. Naming a staff role
adminorsubscriberdoes not grant ownership or platform access; those names are reserved. Assign staff only the permissions they need. Dedicated database hosting keeps the same staff accounts and permissions. - Custom Roles: You can create any number of custom roles to fit your business needs.
Creating and Editing Roles¶
- Click Create Role (or edit an existing one).
- Name the Role: Give it a clear name like "Morning Cashier".
- Assign Permissions: Permissions are grouped by module (e.g., Products, Orders). For each module, you can grant permissions to:
- View (មើល)
- Create (បង្កើត)
- Edit (កែប្រែ)
- Delete (លុប)
- Smart Selection: If you check "Edit" or "Delete" for a module, the system will automatically check "View", because a user must be able to view a module to edit its contents. If you uncheck "View", all other permissions for that module will be removed.
Safe Deletion¶
If you delete a role, any user who had that role will be safely changed to a basic user with no special permissions. This ensures your system remains secure.