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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user