From fa22007f525b3f253357ca1aa538dfa35d2388d2 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Mon, 8 Dec 2014 16:11:27 +0000
Subject: [PATCH] Rename getRole to getUserType

---
 include/class.auth.php   | 4 ++--
 include/class.client.php | 2 +-
 include/class.staff.php  | 2 +-
 include/class.ticket.php | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/class.auth.php b/include/class.auth.php
index e6fed10c5..b11525895 100644
--- a/include/class.auth.php
+++ b/include/class.auth.php
@@ -4,7 +4,7 @@ interface AuthenticatedUser {
     // Get basic information
     function getId();
     function getUsername();
-    function getRole();
+    function getUserType();
 
     //Backend used to authenticate the user
     function getAuthBackend();
@@ -30,7 +30,7 @@ implements AuthenticatedUser {
     // Get basic information
     abstract function getId();
     abstract function getUsername();
-    abstract function getRole();
+    abstract function getUserType();
 
     //Backend used to authenticate the user
     abstract function getAuthBackend();
diff --git a/include/class.client.php b/include/class.client.php
index a8b39d1e5..39b8241c9 100644
--- a/include/class.client.php
+++ b/include/class.client.php
@@ -232,7 +232,7 @@ class  EndUser extends BaseAuthenticatedUser {
         return $this->user->getEmail();
     }
 
-    function getRole() {
+    function getUserType() {
         return $this->isOwner() ? 'owner' : 'collaborator';
     }
 
diff --git a/include/class.staff.php b/include/class.staff.php
index ebdce1aaa..01af86260 100644
--- a/include/class.staff.php
+++ b/include/class.staff.php
@@ -79,7 +79,7 @@ implements AuthenticatedUser {
 
     // AuthenticatedUser implementation...
     // TODO: Move to an abstract class that extends Staff
-    function getRole() {
+    function getUserType() {
         return 'staff';
     }
 
diff --git a/include/class.ticket.php b/include/class.ticket.php
index 8422e8eef..a4afc52f9 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -321,7 +321,7 @@ class Ticket {
         //Collaborator?
         // 1) If the user was authorized via this ticket.
         if ($user->getTicketId() == $this->getId()
-                && !strcasecmp($user->getRole(), 'collaborator'))
+                && !strcasecmp($user->getUserType(), 'collaborator'))
             return true;
 
         // 2) Query the database to check for expanded access...
-- 
GitLab