From 615ed03fbe80d3eb5df68be1fc68195d8482a5a7 Mon Sep 17 00:00:00 2001 From: Cris Date: Thu, 19 Sep 2019 13:28:15 +0200 Subject: [PATCH] Added method getOE_isEntitledFor() The method checks permission of the logged in user and retrieves all organisational units this user is entitled for. --- application/libraries/PermissionLib.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php index c0e3781a4..348c8b87b 100644 --- a/application/libraries/PermissionLib.php +++ b/application/libraries/PermissionLib.php @@ -274,6 +274,25 @@ class PermissionLib } } + /** + * Returns the organisational units the person is entitled for. + * @param null $berechtigung_kurzbz + * @return array|bool array of oe_kurzbz the person is entitled for. False on error. + */ + public function getOE_isEntitledFor($berechtigung_kurzbz = null) + { + $oe_kurzbz_arr = array(); + + if (self::$bb->getOEkurzbz($berechtigung_kurzbz)) + { + return $oe_kurzbz_arr = self::$bb->getOEkurzbz($berechtigung_kurzbz); + } + else + { + return false; + } + } + //------------------------------------------------------------------------------------------------------------------ // Private methods