table('permission_grants')->whereIn('permission',$p['new_right_names'])->count();if($present!==0)throw new LogicException('Reconcile existing grants before asking');foreach([13,14,15,16,17]as$id)if(!$host->table('company_memberships')->where(['tenant_id'=>1,'company_id'=>2,'user_id'=>$id])->exists())throw new LogicException('Existing recipients required');file_put_contents($work.'/fiscal-rules-access-readonly.json',json_encode(['passed'=>true,'new_right_names'=>3,'proposed_grants'=>7,'existing_new_right_grants'=>0,'new_users'=>0,'grants_applied'=>0],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'book'=>$book,'proof'=>$work.'/fiscal-rules-access-readonly.json']).PHP_EOL;