# Roles and Permissions Guide: Gas Station Management ERP

This document provides a detailed breakdown of what each user role can access and control within the system.

---

## 🏛️ Role Hierarchy Overview

| Role | Level | Primary Responsibility |
| :--- | :---: | :--- |
| **Super Admin** | 1 | Total system control and technical maintenance. |
| **Owner** | 2 | Full business oversight and global configuration. |
| **Brand Manager** | 3 | Regional or brand-specific operational management. |
| **Station Manager** | 4 | Day-to-day operations and pricing for a specific station. |
| **Oiler** | 5 | Transaction entry and shift-level duties. |
| **Fleet Admin** | 6 | Managing fleet customer accounts and usage. |

---

## 🔑 Detailed Access Matrix

### 1. System & Security Settings
*Only high-level administrative roles can change how the system calculates money and handles security.*

| Feature | Super Admin / Owner | Brand / Station Manager | Oiler / Fleet Admin |
| :--- | :---: | :---: | :---: |
| **KHR Exchange Rate** | ✅ Full Access | ❌ No Access | ❌ No Access |
| **Fuel Type Setup** | ✅ Full Access | ❌ No Access | ❌ No Access |
| **User Management** | ✅ Full Access | ❌ No Access | ❌ No Access |
| **Tax Settings** | ✅ Full Access | ❌ No Access | ❌ No Access |
| **App Customization** | ✅ Full Access | ❌ No Access | ❌ No Access |

### 2. Price Management
*Who can control how much fuel costs at the pump.*

| Feature | Super Admin / Owner | Brand / Station Manager | Oiler / Fleet Admin |
| :--- | :---: | :---: | :---: |
| **Update Fuel Prices** | ✅ Yes | ✅ Yes | ❌ View Only |
| **Price History** | ✅ Yes | ✅ Yes | ❌ View Only |
| **Current Rates** | ✅ Yes | ✅ Yes | ✅ View Only |

### 3. Fuel & Inventory Operations
*Managing tanks, pumps, and receiving deliveries.*

| Feature | Super Admin / Owner | Brand / Station Manager | Oiler / Fleet Admin |
| :--- | :---: | :---: | :---: |
| **Tank Monitoring** | ✅ Yes | ✅ Yes | ❌ View Only |
| **Pump / Nozzles** | ✅ Yes | ✅ Yes | ❌ View Only |
| **Fuel Orders** | ✅ Yes | ✅ Yes | ❌ No Access |
| **Delivery Receiving** | ✅ Yes | ✅ Yes | ❌ No Access |
| **Inventory Alerts** | ✅ Yes | ✅ Yes | ✅ View Only |

### 4. Sales & Transactions
*The core daily activity of the gas station.*

| Feature | Super Admin / Owner | Brand / Station Manager | Oiler / Fleet Admin |
| :--- | :---: | :---: | :---: |
| **New Transaction** | ✅ Yes | ✅ Yes | ✅ Yes |
| **Shift Management** | ✅ Control | ✅ Control | ✅ Entry Only |
| **Void/Delete Sale** | ✅ Yes | ❌ Limited | ❌ No Access |
| **Print Receipts** | ✅ Yes | ✅ Yes | ✅ Yes |

### 5. Fleet Management
*Managing corporate and heavy-duty vehicle accounts.*

| Feature | Super Admin / Owner | Brand Manager | Fleet Admin |
| :--- | :---: | :---: | :---: |
| **Add Fleet Account** | ✅ Yes | ✅ Yes | ❌ No Access |
| **Manage Balance** | ✅ Yes | ✅ Yes | ❌ No Access |
| **View Transactions** | ✅ Yes | ✅ Yes | ✅ Yes |
| **Issue Invoices** | ✅ Yes | ✅ Yes | ✅ Yes |

---

## 📊 Reporting & Analytics

*   **Super Admin / Owner:** Access to all reports across all brands and stations.
*   **Brand Manager:** Access to reports for all stations under their specific brand.
*   **Station Manager:** Access to reports for their assigned station only.
*   **Oiler:** Restricted to "Daily Sales" and "Shift" reports for their current work.
*   **Fleet Admin:** Access to "Fleet Usage" and customer-specific billing reports.

---

## 💡 Quick Tips for Management

*   **Changing Prices:** If a price changes at midnight, a **Station Manager** can log in and update the "Fuel Price" immediately.
*   **Security:** If an Oiler forgets their password, only an **Owner** or **Super Admin** can reset it in the "User Management" section.
*   **Exchange Rate:** If the KHR rate changes (e.g., from 4100 to 4000), it must be updated by the **Owner** under **Price Management > Exchange Rate**.
