From 3f4e26c746b83641052264c4fec82cd0923b0ce5 Mon Sep 17 00:00:00 2001 From: sbyrd Date: Fri, 4 Dec 2020 21:13:35 -0500 Subject: [PATCH] roles --- image.php | 10 ++++++++++ imageAnnotations.php | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/image.php b/image.php index a8387aa..ee206bc 100644 --- a/image.php +++ b/image.php @@ -62,4 +62,14 @@ class image extends objectStructs else return false; } + + public function hasRole( string $Role) + { + if (isset($this->annotations->roles[$Role]) ) + return true; + elseif ( isset($this->annotations->roles[ucfirst($Role) ] ) ) + return true; + else + return false; + } } \ No newline at end of file diff --git a/imageAnnotations.php b/imageAnnotations.php index cd6b70f..2411590 100644 --- a/imageAnnotations.php +++ b/imageAnnotations.php @@ -24,4 +24,14 @@ class imageAnnotations extends objectStructs $this->roles = explode(',',$this->roles); } } + + public function hasRole( string $Role) + { + if (isset($this->roles[$Role]) ) + return true; + elseif ( isset($this->roles[ucfirst($Role) ] ) ) + return true; + else + return false; + } } \ No newline at end of file