Fix: wildcard permissions (GM modules visible), Admin link and module card

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Talal Sharabi
2026-02-22 14:49:27 +04:00
parent 842678674b
commit 6034f774ed
2 changed files with 30 additions and 12 deletions

View File

@@ -83,6 +83,16 @@ function DashboardContent() {
href: '/marketing',
description: 'الحملات التسويقية والعملاء المحتملين',
permission: 'marketing'
},
{
id: 'admin',
name: 'لوحة الإدارة',
nameEn: 'Admin Panel',
icon: Shield,
color: 'bg-red-500',
href: '/admin',
description: 'إدارة المستخدمين والأدوار وسجل العمليات',
permission: 'admin'
}
]
@@ -118,7 +128,7 @@ function DashboardContent() {
</div>
{/* Admin Panel Link - Only for admins */}
{user?.role?.name === 'المدير العام' && (
{(hasPermission('admin', 'view') || user?.role?.name === 'المدير العام' || user?.role?.nameEn === 'General Manager') && (
<Link
href="/admin"
className="p-2 hover:bg-red-50 rounded-lg transition-colors relative group"