## Summary - consolidate internal platform naming from `Tenant` to `Environment` / `ManagedEnvironment` across models, controllers, services, and Filament resources - rename environment-scoped UI surfaces such as dashboards, chooser flows, navigation, and related widgets to match the updated environment-first domain language - align middleware, onboarding/review lifecycle services, jobs, and route/context controllers with the new environment-scoped architecture ## Validation - not rerun as part of this commit/push/PR request ## Notes - branch is 1 commit ahead of `platform-dev` - main commit: `refactor: consolidate internal tenant model naming` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #355
35 lines
1.2 KiB
PHP
35 lines
1.2 KiB
PHP
<?php
|
|
|
|
use App\Models\ManagedEnvironmentPermission;
|
|
use App\Support\Links\RequiredPermissionsLinks;
|
|
|
|
it('renders required permissions overview with missing-first ordering and feature cards', function (): void {
|
|
[$user, $tenant] = createUserWithTenant(role: 'readonly');
|
|
|
|
$configured = config('intune_permissions.permissions', []);
|
|
if (! is_array($configured) || count($configured) < 2) {
|
|
test()->markTestSkipped('Need at least 2 required permissions configured.');
|
|
}
|
|
|
|
$grantedKey = (string) ($configured[0]['key'] ?? '');
|
|
$missingKey = (string) ($configured[1]['key'] ?? '');
|
|
|
|
if ($grantedKey === '' || $missingKey === '') {
|
|
test()->markTestSkipped('Configured permission keys missing.');
|
|
}
|
|
|
|
ManagedEnvironmentPermission::create([
|
|
'managed_environment_id' => (int) $tenant->getKey(),
|
|
'permission_key' => $grantedKey,
|
|
'status' => 'granted',
|
|
'details' => ['source' => 'db'],
|
|
'last_checked_at' => now(),
|
|
]);
|
|
|
|
$this->actingAs($user)
|
|
->get(RequiredPermissionsLinks::requiredPermissions($tenant, ['status' => 'all']))
|
|
->assertSuccessful()
|
|
->assertSee('Blocked', false)
|
|
->assertSeeInOrder([$missingKey, $grantedKey], false);
|
|
});
|