Overview
Yoneily’s user management system provides comprehensive control over user accounts, vendor registration, role-based access control, and granular permissions through ACL (Access Control Lists).User Types
Administrators
Full system access with ability to manage all users, vendors, and permissions
Vendors
Store owners with access to their own inventory, sales, and customer interactions
User Fields
The user system tracks the following information:| Field | Description |
|---|---|
id_usuario | Unique user identifier (primary key) |
username | Login username (minimum 4 characters) |
email_usuario | User email address |
password | Encrypted password (SHA-1 hash) |
perfil_usuario | User’s full name/profile |
groups_idgrupos | Group ID (role assignment) |
locale_id_local | Associated store/locale ID for vendors |
fecharreg_usuario | Registration timestamp |
User Management Workflows
Creating Users
Add New User
Click “Add User” and fill in the required fields:
- Username (minimum 4 characters)
- Email address
- Full name/profile
- Password
- Assign user group (Administrator or Vendor)
Assign Store (Vendors Only)
For vendor accounts, select the associated store/locale from the dropdown
Vendor Registration
Vendors can self-register through a public registration form:Vendors register with a unique store code that validates against existing locales in the system.
- Vendor accesses the registration page (
/users/add_vendedor) - Enters store code to validate their business
- Fills in credentials and profile information
- System validates the code against the
localestable - Password is hashed using
Security::hash()before storage - Upon success, vendor is redirected to confirmation page
Groups & Roles
Available Groups
- Administrators
- Vendors
Group ID: 1Name: administradoresCapabilities:
- Full system access
- Manage all users and vendors
- Configure permissions
- Access all stores and inventory
- View comprehensive reports
Access Control Lists (ACL)
ACL Architecture
Yoneily implements a hierarchical ACL system using CakePHP’s built-in ACL component:Managing Permissions
View Permission Tree
The system displays all available controllers and actions:
- Parent nodes represent controllers
- Child nodes represent specific actions
- Green checkmarks indicate granted permissions
Toggle Permissions
Click on any permission to toggle access:
- Allow: User can execute the action
- Deny: User is blocked from the action
Permission AJAX System
Theajax_load action handles real-time permission changes:
-
Key Parameters:
key: User IDkey2: ACO alias (controller/action)key3: Current status (0 = denied, 1 = allowed)
-
Behavior:
- Toggles permission using
$this->Acl->allow()or$this->Acl->deny() - Updates database immediately
- Returns new status to update UI
- Toggles permission using
User Operations
Editing Users
Edit Workflow:- Select user from the user list
- Modify fields as needed
- If changing groups:
- System finds user’s ARO record
- Finds new group’s ARO record
- Updates parent_id to maintain hierarchy
- Save changes
Password Management
Users can change their passwords through a secure workflow:- User accesses
/users/edit_pass/{id} - Enters current password for verification
- Enters new password twice
- System validates:
- Current password matches stored hash
- New passwords match each other
- Minimum length requirements met
- New password is hashed and saved
Deleting Users
The delete action (/users/delete/{id}) permanently removes the user record from the database.
Authentication System
Login Process
- User accesses
/users/login - Enters username and password
- CakePHP Auth component:
- Hashes submitted password
- Compares with stored hash
- Validates group membership
- Checks ACL permissions
- On success:
- Session is created
- User data stored in
Auth.User - Redirected to admin home
Session Data
The following user data is stored in the session:Logout
Users can logout via/users/logout, which:
- Destroys the session
- Clears Auth data
- Redirects to login page
- Displays logout confirmation message
Reports & Exports
User Reports
Administrators can generate PDF reports:Individual User Report
Generate a detailed PDF for a specific userRoute:
/users/pdf/{id}Complete User Report
Generate a comprehensive PDF of all usersRoute:
/users/pdf_completoStore Code Validation
The system includes an AJAX endpoint for validating vendor store codes:locales table.
Best Practices
Password Security
Password Security
- Enforce minimum 4-character passwords
- All passwords are hashed with SHA-1 + salt
- Never store plaintext passwords
- Require old password for password changes
Permission Management
Permission Management
- Start with group-level permissions
- Use individual overrides sparingly
- Regularly audit vendor permissions
- Test permission changes before deployment
Vendor Management
Vendor Management
- Validate store associations
- Review vendor registrations regularly
- Ensure locale_id is properly set
- Monitor vendor activity and sales
Related Features
Inventory Management
Manage products and stock levels
Sales Tracking
Monitor sales and transactions
Complaints System
Handle customer feedback