feat(firewall): add scoped rule administration reads
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -24,6 +24,23 @@ final class SystemFirewallRuleService
|
||||
return $this->rules->list(FirewallRuleScope::system(), $activeOnly);
|
||||
}
|
||||
|
||||
public function queryRules(
|
||||
string $status = 'active',
|
||||
?string $type = null,
|
||||
?string $action = null,
|
||||
int $limit = 50,
|
||||
int $offset = 0
|
||||
): array {
|
||||
$this->requirePermission(self::PERMISSION_READ);
|
||||
return $this->rules->query(FirewallRuleScope::system(), $status, $type, $action, $limit, $offset);
|
||||
}
|
||||
|
||||
public function fetchRule(string $ruleId): ?FirewallRuleObject
|
||||
{
|
||||
$this->requirePermission(self::PERMISSION_READ);
|
||||
return $this->rules->fetch(FirewallRuleScope::system(), $ruleId);
|
||||
}
|
||||
|
||||
public function blockIp(string $ip, ?string $reason = null, ?int $durationSeconds = null): FirewallRuleObject
|
||||
{
|
||||
$this->requirePermission(self::PERMISSION_MANAGE);
|
||||
|
||||
Reference in New Issue
Block a user