requirePermission(self::PERMISSION_READ); return $this->rules->list($this->scope(), $activeOnly); } public function blockIp(string $ip, ?string $reason = null, ?int $durationSeconds = null): FirewallRuleObject { $this->requirePermission(self::PERMISSION_MANAGE); return $this->rules->blockIp( $this->scope(), $ip, $reason, $this->identity->identifier(), $durationSeconds ); } public function allowIp(string $ip, ?string $reason = null): FirewallRuleObject { $this->requirePermission(self::PERMISSION_MANAGE); return $this->rules->allowIp($this->scope(), $ip, $reason, $this->identity->identifier()); } public function blockIpRange(string $cidr, ?string $reason = null): FirewallRuleObject { $this->requirePermission(self::PERMISSION_MANAGE); return $this->rules->blockIpRange($this->scope(), $cidr, $reason, $this->identity->identifier()); } public function blockDevice( string $fingerprint, ?string $reason = null, ?int $durationSeconds = null ): FirewallRuleObject { $this->requirePermission(self::PERMISSION_MANAGE); return $this->rules->blockDevice( $this->scope(), $fingerprint, $reason, $this->identity->identifier(), $durationSeconds ); } public function disableRule(string $ruleId): bool { $this->requirePermission(self::PERMISSION_MANAGE); return $this->rules->disable($this->scope(), $ruleId, $this->identity->identifier()); } public function removeRule(string $ruleId): bool { $this->requirePermission(self::PERMISSION_MANAGE); return $this->rules->remove($this->scope(), $ruleId, $this->identity->identifier()); } private function scope(): FirewallRuleScope { return FirewallRuleScope::tenant($this->tenant->requireIdentifier()); } private function requirePermission(string $permission): void { if (!$this->identity->hasPermission($permission)) { throw new \RuntimeException("Missing required permission: {$permission}"); } } }