<?php
declare(strict_types=1);
namespace App\Controllers;
use App\Core\Auth;use App\Core\Controller;use App\Core\Permission;use App\Services\ZeroTrustPolicyService;
final class ZeroTrustPolicyController extends Controller
{
 public function index():void{Auth::requireLogin();Permission::require('soc.zero_trust.view');$svc=new ZeroTrustPolicyService();$this->view('security/zero_trust',['pageTitle'=>'Zero Trust Policy Engine','report'=>$svc->dashboard()]);}
 public function save():void{Auth::requireLogin();Permission::require('soc.zero_trust.manage');(new ZeroTrustPolicyService())->save($_POST);header('Location: /public/administration/securite/soc/zero-trust');exit;}
 public function simulate():void{Auth::requireLogin();Permission::require('soc.zero_trust.simulate');$svc=new ZeroTrustPolicyService();$result=$svc->simulate($_POST);$this->view('security/zero_trust',['pageTitle'=>'Zero Trust Policy Engine','report'=>$svc->dashboard(),'simulation'=>$result]);}
 public function toggle():void{Auth::requireLogin();Permission::require('soc.zero_trust.manage');(new ZeroTrustPolicyService())->toggle((int)($_POST['id']??0));header('Location: /public/administration/securite/soc/zero-trust');exit;}
}
