virtualhost hostc create

This commit is contained in:
sbyrd 2020-12-18 22:08:55 -05:00
parent 6bae547730
commit ef7d996bf4
1 changed files with 13 additions and 2 deletions

View File

@ -78,13 +78,24 @@ class image extends objectStructs
public function hasRole( string $Role) 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) ] ) ) if (isset($this->annotations->roles[$Role]) OR isset($this->annotations->roles[ucfirst($Role) ] ) )
{ {
$this->Log(__FUNCTION__ . "--Image has role: $Role"); $this->Log(__FUNCTION__ . "--Image has role: $Role");
return true; return true;
} }
else 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;
} }
} }