From 80b0b2bccbaaee5fcb66f071f1a0784cb80e85be Mon Sep 17 00:00:00 2001 From: sbyrd Date: Fri, 18 Dec 2020 22:16:02 -0500 Subject: [PATCH] roles --- image.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/image.php b/image.php index 535101f..c15f761 100644 --- a/image.php +++ b/image.php @@ -81,13 +81,24 @@ class image extends objectStructs public function hasRole( string $Role) { - $this->Log(__FUNCTION__ . "Checking Role: $Role"); + $this->Log(__FUNCTION__ . " Checking Role: $Role"); if (isset($this->annotations->roles[$Role]) OR isset($this->annotations->roles[ucfirst($Role) ] ) ) { $this->Log(__FUNCTION__ . "--Image has role: $Role"); return true; } else - return false; + { + foreach($this->annotations->roles as $RoleRow) + { + if ($RoleRow === $Role) + { + $this->Log(__FUNCTION__ . "--Image has role (found as role value and not key): $Role"); + } + } + } + $this->Log(__FUNCTION__ . "--Image does not seem to have role as key or as value within ->roles array "); + + return false; } } \ No newline at end of file