TenantAtlas/apps/platform/database/seeders/PlatformUserSeeder.php
ahmido d96abc65fb
Some checks failed
Main Confidence / confidence (push) Failing after 1m23s
Remove Findings lifecycle backfill operational surface (controls slice) (#280)
Removes the Findings lifecycle backfill from the Operational Controls UI and OperationalControlCatalog.

This patch is a safe, controls-only change; runbooks, jobs and other runtime artifacts are NOT removed yet. Follow-up work will delete the runbook service/scope, jobs, commands, and update tests.

Files changed:
- apps/platform/app/Filament/System/Pages/Ops/Controls.php
- apps/platform/app/Support/OperationalControls/OperationalControlCatalog.php
- apps/platform/tests/Feature/System/OpsControls/OperationalControlManagementTest.php
- apps/platform/tests/Unit/Support/OperationalControls/OperationalControlCatalogTest.php
- apps/platform/tests/Unit/Support/OperationalControls/OperationalControlScopeResolutionTest.php

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #280
2026-04-26 15:43:47 +00:00

52 lines
1.7 KiB
PHP

<?php
namespace Database\Seeders;
use App\Models\PlatformUser;
use App\Models\Tenant;
use App\Models\Workspace;
use App\Support\Auth\PlatformCapabilities;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
class PlatformUserSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$workspace = Workspace::query()->firstOrCreate(
['slug' => 'default'],
['name' => 'Default Workspace', 'slug' => 'default'],
);
Tenant::query()->updateOrCreate(
['external_id' => 'platform'],
['name' => 'Platform', 'workspace_id' => (int) $workspace->getKey()],
);
PlatformUser::query()->updateOrCreate(
['email' => 'operator@tenantpilot.io'],
[
'name' => 'Platform Operator',
'password' => Hash::make('password'),
'capabilities' => [
PlatformCapabilities::ACCESS_SYSTEM_PANEL,
PlatformCapabilities::USE_BREAK_GLASS,
PlatformCapabilities::CONSOLE_VIEW,
PlatformCapabilities::DIRECTORY_VIEW,
PlatformCapabilities::OPERATIONS_VIEW,
PlatformCapabilities::OPERATIONS_MANAGE,
PlatformCapabilities::OPS_VIEW,
PlatformCapabilities::RUNBOOKS_VIEW,
PlatformCapabilities::RUNBOOKS_RUN,
PlatformCapabilities::RUNBOOKS_FINDINGS_LIFECYCLE_BACKFILL,
PlatformCapabilities::OPS_CONTROLS_MANAGE,
],
'is_active' => true,
],
);
}
}