## Summary - hard-cut environment-owned CTA links into workspace hubs to canonical `environment_id` filters - add shared workspace-hub environment filter resolution and visible filtered-state rendering across in-scope hubs - update workspace hub pages, link helpers, and focused test coverage for explicit environment CTA filtering ## Validation - Not run in this workflow Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #370
28 lines
865 B
PHP
28 lines
865 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\ProviderConnection;
|
|
|
|
it('returns 403 for tenant members without PROVIDER_MANAGE capability on create and edit', function (): void {
|
|
[$user, $tenant] = createUserWithTenant(role: 'readonly');
|
|
|
|
$connection = ProviderConnection::factory()->create([
|
|
'workspace_id' => (int) $tenant->workspace_id,
|
|
'managed_environment_id' => (int) $tenant->getKey(),
|
|
'provider' => 'microsoft',
|
|
]);
|
|
|
|
$this->actingAs($user)
|
|
->get('/admin/provider-connections/create?environment_id='.(int) $tenant->getKey())
|
|
->assertForbidden();
|
|
|
|
$this->actingAs($user)
|
|
->get('/admin/provider-connections/'.$connection->getKey())
|
|
->assertOk();
|
|
|
|
$this->actingAs($user)
|
|
->get('/admin/provider-connections/'.$connection->getKey().'/edit')
|
|
->assertForbidden();
|
|
});
|