diff --git a/include/class.staff.php b/include/class.staff.php index 7f2392b5158708f7fb4bb0e3eafd10e1eccbcfd3..2b0471a4cabca3f7c254482ce1f0fcd878e1b0c9 100644 --- a/include/class.staff.php +++ b/include/class.staff.php @@ -477,10 +477,13 @@ implements AuthenticatedUser, EmailContact, TemplateVariable, Searchable { if (is_null($dept)) return $this->role; - if ((!$dept instanceof Dept) && !($dept=Dept::lookup($dept))) - return null; + if (is_numeric($dept)) + $deptId = $dept; + elseif($dept instanceof Dept) + $deptId = $dept->getId(); + else + return null; - $deptId = $dept->getId(); $roles = $this->getRoles(); if (isset($roles[$deptId])) return $roles[$deptId];