Fix for AreaSecurity when presented security is null
This commit is contained in:
parent
e9895aee45
commit
9abfd88e3d
@ -13,7 +13,7 @@ trait AreaSecurity
|
|||||||
* @param int $sec
|
* @param int $sec
|
||||||
* @return bool
|
* @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);
|
return $this->can_read($sec) || $this->can_write($sec);
|
||||||
}
|
}
|
||||||
@ -24,7 +24,7 @@ trait AreaSecurity
|
|||||||
* @param int $sec
|
* @param int $sec
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function can_read(int $sec): bool
|
public function can_read(?int $sec): bool
|
||||||
{
|
{
|
||||||
return $this->active && (($sec >= ($x=$this->getSecReadAttribute())) && $x);
|
return $this->active && (($sec >= ($x=$this->getSecReadAttribute())) && $x);
|
||||||
}
|
}
|
||||||
@ -35,7 +35,7 @@ trait AreaSecurity
|
|||||||
* @param int $sec
|
* @param int $sec
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function can_write(int $sec): bool
|
public function can_write(?int $sec): bool
|
||||||
{
|
{
|
||||||
return $this->active && (($sec >= ($x=$this->getSecWriteAttribute())) && $x);
|
return $this->active && (($sec >= ($x=$this->getSecWriteAttribute())) && $x);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user