fix(settings): expose SuperAdmin feature flags to customer get_settings
Menu gates like enable_product_funds were missing from the public API, so the user app could not hide disabled features. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -39,6 +39,22 @@ class SuperAdminProgramSettingsOverlay
|
||||
'show_to_users_chat',
|
||||
];
|
||||
|
||||
/**
|
||||
* دسترسیهای سوپرادمین که منو/مسیر اپ کاربر را کنترل میکنند.
|
||||
* باید همیشه در api/get_settings مشتری برسند (show_to_user).
|
||||
*/
|
||||
public const CLIENT_FEATURE_KEYS = [
|
||||
'enable_conditional_order',
|
||||
'enable_product_funds',
|
||||
'has_page_earn_money',
|
||||
'has_page_gift_card',
|
||||
'has_page_notification',
|
||||
'has_page_price_trigger',
|
||||
'jibit_enabled',
|
||||
'permision__enabled',
|
||||
'show_to_users_chat',
|
||||
];
|
||||
|
||||
/** کلیدهایی که هنوز صفحهٔ اختصاصی ادمین خانگی مالکشان است — از overlay دور انداخته میشوند */
|
||||
public const LOCAL_OWNED_KEYS = [
|
||||
'tracking_systems',
|
||||
@@ -291,4 +307,9 @@ class SuperAdminProgramSettingsOverlay
|
||||
{
|
||||
return in_array(trim($key), self::SUPERADMIN_OWNED_KEYS, true);
|
||||
}
|
||||
|
||||
public static function isClientFeatureKey(string $key): bool
|
||||
{
|
||||
return in_array(trim($key), self::CLIENT_FEATURE_KEYS, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user