From 73a95e055b69585266c28158428afbf2bcd2f4d0 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 24 Aug 2022 16:15:04 +0200 Subject: [PATCH] ObjectAuthorization: Gracefully handle incomplete objects in `grantsOn()` --- library/Icingadb/Authentication/ObjectAuthorization.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/Icingadb/Authentication/ObjectAuthorization.php b/library/Icingadb/Authentication/ObjectAuthorization.php index ba5aa17e..0792988b 100644 --- a/library/Icingadb/Authentication/ObjectAuthorization.php +++ b/library/Icingadb/Authentication/ObjectAuthorization.php @@ -44,6 +44,10 @@ class ObjectAuthorization $tableName = $for->getTableName(); $uniqueId = $for->{$for->getKeyName()}; + if (! isset($uniqueId)) { + return false; + } + if (! isset(self::$knownGrants[$tableName][$uniqueId])) { $self->loadGrants( get_class($for),