Hotel Guevarini has two user roles defined in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/EmirPolito/CRUD-HOTEL-GUEVARINI-Publico/llms.txt
Use this file to discover all available pages before exploring further.
roles database table. Each role controls which sections of the panel are visible and which actions a user can perform.
id_rol | Role Name |
|---|---|
1 | Administrator |
2 | Client |
Permissions Matrix
| Feature | Administrator | Client |
|---|---|---|
| Dashboard | ✓ | ✓ |
| View Rooms | ✓ | ✓ |
| Manage Rooms | ✓ | ✗ |
| View Reservations | ✓ | ✓ |
| Create/Edit Reservations | ✓ | ✓ |
| View Clients | ✓ | ✗ |
| Manage Clients | ✓ | ✗ |
| Manage Users | ✓ | ✗ |
How Roles Are Checked in PHP
After a user logs in, their role ID is stored in the session as$_SESSION['usuario_rol_id']. PHP views read this value to decide what to show.
In views/panel.php, the role check looks like this:
1 is treated as a Client. This pattern is applied consistently across views to hide administrative sections from Client users.
The Users navigation link in the top navbar only appears for Administrators (
$rol_id == 1). Clients have no route to the user management section from the UI.Role Assignment
Roles are assigned at the time a user account is created:-
Public self-registration (
php/auth/procesar_registro.php) always assigns role2(Client). This is hardcoded and cannot be changed by the registering user: -
Admin-created users (
php/usuarios/guardar_usuario.php) allow the administrator to select any role from a dropdown when filling out the creation form:
How to Change a User’s Role
Only an Administrator can change a user’s role after the account has been created.Navigate to User Management
From the panel, click the Usuarios link in the top navigation bar. This link is only visible to Administrators.