From ef7d996bf49691a98016c88b9bfef1d3c01eab02 Mon Sep 17 00:00:00 2001 From: sbyrd Date: Fri, 18 Dec 2020 22:08:55 -0500 Subject: [PATCH] virtualhost hostc create --- image.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/image.php b/image.php index 30d76ff..e2f0446 100644 --- a/image.php +++ b/image.php @@ -78,13 +78,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