- Fix togglePermission() to always include all permission keys with false defaults - Add migration to backfill null/empty Manager permissions with config defaults - Rename nudge UI text from "Relance" to "Notification"/"Notifier" across 8 files - Fix select-all checkbox and show checkboxes on all declaration rows - Remove en_attente_client status restriction from BulkNotificationController Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
35 lines
1008 B
PHP
35 lines
1008 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Backfill Manager workspace_user rows that have null or empty permissions
|
|
* with the defaults from config('permissions.defaults.manager').
|
|
*/
|
|
public function up(): void
|
|
{
|
|
$defaults = json_encode(config('permissions.defaults.manager'));
|
|
|
|
DB::table('workspace_user')
|
|
->where('role', 'manager')
|
|
->where(function ($query) {
|
|
$query->whereNull('permissions')
|
|
->orWhere('permissions', '[]')
|
|
->orWhere('permissions', 'null')
|
|
->orWhere('permissions', '');
|
|
})
|
|
->update(['permissions' => $defaults]);
|
|
}
|
|
|
|
/**
|
|
* Reverse the migration (no-op — we cannot know original values).
|
|
*/
|
|
public function down(): void
|
|
{
|
|
// Cannot reverse: original null/empty values are indistinguishable
|
|
}
|
|
};
|