setting pushed

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-23 22:34:18 +03:30
co-authored by Cursor
parent d3997cfc8f
commit d2fd315e8a
3 changed files with 306 additions and 10 deletions
@@ -22,6 +22,26 @@ class SuperAdminProgramSettingsOverlay
private const LAST_GOOD_CACHE_MINUTES = 1440;
/**
* تنها کلیدهایی که مالکشان سوپرادمین است — گروه «دسترسی مشتری به قابلیت‌ها».
* هر کلید دیگری مالکش جدول settings همین نصب است و در overlay دور ریخته می‌شود.
*/
public const SUPERADMIN_OWNED_KEYS = [
'customer_direct_sms',
'customer_special_pricing',
'enable_conditional_order',
'enable_customer_level_profit',
'enable_product_funds',
'group_sms',
'has_page_earn_money',
'has_page_gift_card',
'has_page_notification',
'has_page_price_trigger',
'jibit_enabled',
'permision__enabled',
'show_to_users_chat',
];
/** کلیدهایی که هنوز صفحهٔ اختصاصی ادمین خانگی مالک‌شان است */
public const LOCAL_OWNED_KEYS = [
'tracking_systems',
@@ -114,7 +134,7 @@ class SuperAdminProgramSettingsOverlay
continue;
}
$key = trim((string) ($row['key'] ?? ''));
if ($key === '' || in_array($key, self::LOCAL_OWNED_KEYS, true) || in_array($key, self::RUNTIME_KEYS, true)) {
if ($key === '' || ! self::isSuperAdminOwned($key)) {
continue;
}
$map[$key] = $row;
@@ -192,4 +212,9 @@ class SuperAdminProgramSettingsOverlay
{
return in_array($key, self::LOCAL_OWNED_KEYS, true);
}
public static function isSuperAdminOwned(string $key): bool
{
return in_array(trim($key), self::SUPERADMIN_OWNED_KEYS, true);
}
}