Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 1m0s
This PR removes the legacy "acknowledged" status compatibility for findings and unifies the canonical operation types (e.g., transitioning from baseline_capture to baseline.capture). It includes updated tests, models, and services to reflect these changes. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #296
29 lines
1.3 KiB
PHP
29 lines
1.3 KiB
PHP
<?php
|
|
|
|
use App\Support\Auth\Capabilities;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
it('enforces manager must-allow and must-not capabilities', function () {
|
|
[$user, $tenant] = createUserWithTenant(role: 'manager');
|
|
|
|
$gate = Gate::forUser($user);
|
|
|
|
expect($gate->allows(Capabilities::TENANT_VIEW, $tenant))->toBeTrue();
|
|
expect($gate->allows(Capabilities::TENANT_SYNC, $tenant))->toBeTrue();
|
|
expect($gate->allows(Capabilities::TENANT_INVENTORY_SYNC_RUN, $tenant))->toBeTrue();
|
|
expect($gate->allows(Capabilities::TENANT_FINDINGS_TRIAGE, $tenant))->toBeTrue();
|
|
expect($gate->allows(Capabilities::TENANT_MANAGE, $tenant))->toBeTrue();
|
|
|
|
expect($gate->allows(Capabilities::TENANT_BACKUP_SCHEDULES_RUN, $tenant))->toBeTrue();
|
|
expect($gate->allows(Capabilities::TENANT_BACKUP_SCHEDULES_MANAGE, $tenant))->toBeTrue();
|
|
|
|
expect($gate->allows(Capabilities::PROVIDER_VIEW, $tenant))->toBeTrue();
|
|
expect($gate->allows(Capabilities::PROVIDER_RUN, $tenant))->toBeTrue();
|
|
expect($gate->allows(Capabilities::PROVIDER_MANAGE, $tenant))->toBeTrue();
|
|
|
|
expect($gate->allows(Capabilities::AUDIT_VIEW, $tenant))->toBeTrue();
|
|
|
|
expect($gate->allows(Capabilities::TENANT_MEMBERSHIP_MANAGE, $tenant))->toBeFalse();
|
|
expect($gate->allows(Capabilities::TENANT_DELETE, $tenant))->toBeFalse();
|
|
});
|