make([ 'capabilities' => [PlatformCapabilities::ACCESS_SYSTEM_PANEL], ]); expect($platformUser->canAccessPanel(app(PanelRegistry::class)->get('system')))->toBeTrue() ->and($platformUser->canAccessPanel(app(PanelRegistry::class)->get('admin')))->toBeFalse(); }); it('denies ordinary workspace users on system panel routes as not found', function (): void { [$user] = createUserWithTenant(role: 'owner'); $this->actingAs($user) ->get('/system') ->assertNotFound(); $this->actingAs($user) ->get('/system/directory/workspaces') ->assertNotFound(); }); it('keeps missing system capability as forbidden for platform users', function (): void { $platformUser = PlatformUser::factory()->create([ 'capabilities' => [], 'is_active' => true, ]); $this->actingAs($platformUser, 'platform') ->get('/system') ->assertForbidden(); });