From 9abfd88e3d43563231afa1ca3fffd0ab0d41c4ea Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 26 Apr 2024 16:27:15 +1000 Subject: [PATCH] Fix for AreaSecurity when presented security is null --- app/Traits/AreaSecurity.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Traits/AreaSecurity.php b/app/Traits/AreaSecurity.php index 2a9128b..20ed820 100644 --- a/app/Traits/AreaSecurity.php +++ b/app/Traits/AreaSecurity.php @@ -13,7 +13,7 @@ trait AreaSecurity * @param int $sec * @return bool */ - public function can_access(int $sec): bool + public function can_access(?int $sec): bool { return $this->can_read($sec) || $this->can_write($sec); } @@ -24,7 +24,7 @@ trait AreaSecurity * @param int $sec * @return bool */ - public function can_read(int $sec): bool + public function can_read(?int $sec): bool { return $this->active && (($sec >= ($x=$this->getSecReadAttribute())) && $x); } @@ -35,7 +35,7 @@ trait AreaSecurity * @param int $sec * @return bool */ - public function can_write(int $sec): bool + public function can_write(?int $sec): bool { return $this->active && (($sec >= ($x=$this->getSecWriteAttribute())) && $x); }