E-DUKA PERMISSION INTEGRATION

1. Copy:
   permissions.php
   to:
   C:\xampp\htdocs\e_duka\config\permissions.php

2. IMPORTANT:
   Your login session must contain:
   $_SESSION['user_id']
   and preferably:
   $_SESSION['role']

3. Protect a page:
   require_once "../config/permissions.php";
   requirePermission('view_profit_loss');

4. Hide a menu item:
   if (hasPermission('view_profit_loss')) {
       // show menu link
   }

5. Example cashier:
   Give:
   create_sale
   view_sales
   return_sale
   view_stock
   view_customers
   add_customer

   Do NOT give:
   view_profit_loss
   view_cogs
   view_sales_report
   view_expense_report
   view_expenses
   view_purchase_orders

6. Super admin automatically bypasses permission checks in this helper.

IMPORTANT:
Do not only hide menu links. Put requirePermission() at the top of every protected page too.
