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:
2026-08-25 14:19:22 +03:30
co-authored by Cursor
parent dfa6d792ee
commit 793c8cd9ed
4 changed files with 39 additions and 1 deletions
@@ -56,9 +56,14 @@ class SettingsController extends Controller
return response()->json([]);
}
$clientFeatureKeys = SuperAdminProgramSettingsOverlay::CLIENT_FEATURE_KEYS;
$local = Setting::query()
->select(Setting::adminSelectColumns())
->where('show_to_user', 1)
->where(function ($query) use ($clientFeatureKeys) {
$query->where('show_to_user', 1)
->orWhereIn('key', $clientFeatureKeys);
})
->orderBy('key')
->get();
@@ -407,6 +412,13 @@ class SettingsController extends Controller
$setting->show_to_user = $local->show_to_user;
}
}
// دسترسی‌های منوی اپ کاربر همیشه به کلاینت می‌رسند (حتی اگر local show_to_user=0 یا absent)
if (
Setting::hasShowToUserColumn()
&& SuperAdminProgramSettingsOverlay::isClientFeatureKey((string) $setting->key)
) {
$setting->show_to_user = 1;
}
return $setting;
}