{% extends "base.html" %} {% block title %}အသုံးပြုသူများနှင့် လုပ်ပိုင်ခွင့်များ (RBAC) | myplayer Biz{% endblock %} {% block content %}
ဝန်ထမ်း စုစုပေါင်း (Total Staff)

{{ current_users_count }}

👥
တက်ကြွဆဲ (Active Staff)

{{ active_users_count }}

✓
အရောင်းဝန်ထမ်း (Cashiers)

{{ cashiers_count }}

🛒
စီမံခန့်ခွဲသူ (Management)

{{ managers_count }}

👔
ရာထူးအလိုက် ခွဲဝေမှု (By Role)
ဆိုင်ခွဲအလိုက် အသုံးပြုသူများ (Users by Branch)
Plan အသုံးပြုမှု (Seat Usage)
အသုံးပြုပြီး{{ current_users_count }} / {{ max_users if max_users else '∞' }}
{% if max_users %}
{% endif %}
Active{{ active_users_count }}
Inactive / ပိတ်ထားသော{{ current_users_count - active_users_count }}

ရာထူးအလိုက် အခွင့်အရေး (Permissions) ကို အသုံးပြုသူ ပြင်ဆင်သည့် နေရာတွင် သတ်မှတ်နိုင်ပါသည်။
🛡️ ဝန်ထမ်းအကောင့်များနှင့် လုပ်ပိုင်ခွင့်များ (Role & Permissions RBAC)
{{ active_branch.name if active_branch else 'HQ All' }}
အခန်းကဏ္ဍ (Role) နှင့် Sidebar Menu အလိုက် ဝင်ရောက်ခွင့်များကို Multi-Branch စနစ်ဖြင့် စီမံပါ
{% if deployment_mode == 'SAAS' %} Seats: {{ current_users_count }} / {{ max_users }} ({{ plan_name }}) {% else %} အသုံးပြုသူများ: {{ current_users_count }} / ∞ (Standalone — အကန့်အသတ်မရှိ) {% endif %} {% if is_limit_reached %} Limit ပြည့်ပါပြီ {% endif %}
{% for u in users %} {% else %} {% endfor %}
အသုံးပြုသူ (Profile) အခန်းကဏ္ဍ (Role) တာဝန်ကျ ဆိုင်ခွဲ လုပ်ပိုင်ခွင့်များ (Permissions) အခြေအနေ လုပ်ဆောင်ချက်
{{ u.full_name[0]|upper if u.full_name else 'U' }}
{{ u.full_name }}
@{{ u.username }} {% if u.created_at %} • {{ u.created_at | format_time(branch_timezone) }} {% endif %}
{% if u.role == 'SUPER_ADMIN' %} SUPER ADMIN {% elif u.role == 'OWNER' %} OWNER {% elif u.role == 'BRANCH_MANAGER' %} BRANCH MANAGER {% elif u.role == 'ACCOUNTANT' %} ACCOUNTANT {% else %} CASHIER {% endif %} {% if u.branch %} {{ u.branch.name }} {% else %} ဆိုင်ခွဲအားလုံး (HQ All) {% endif %}
{% if u.role in ['SUPER_ADMIN', 'OWNER'] or 'ALL' in (u.permissions or '') %} ⚡ All Modules (ခွင့်ပြုချက်အားလုံး) {% else %} {% set p_raw = u.permissions or '[]' %} {% if 'pos' in p_raw %}POS{% endif %} {% if 'sales_history' in p_raw %}Sales{% endif %} {% if 'purchase_entry' in p_raw %}Purchase{% endif %} {% if 'products' in p_raw %}Catalog{% endif %} {% if 'accounts' in p_raw %}Finance{% endif %} {% if 'reports_pnl' in p_raw %}P&L{% endif %} {% if 'payroll' in p_raw %}Payroll{% endif %} {% endif %}
{% if u.id == session.get('user_id') %} Active (You) {% else %} {% endif %}
{% if u.id != session.get('user_id') and u.role not in ['SUPER_ADMIN', 'OWNER'] %} {% endif %}
ဝန်ထမ်းအကောင့် မှတ်တမ်းများ မရှိသေးပါ။
{{ render_pagination(pagination, 'people.users_manager', branch_id=selected_branch_id, search=search_q) }}
{% endblock %}