From b910f220ac19bd84da3faf58868ab883059e3787 Mon Sep 17 00:00:00 2001 From: hainberg Date: Thu, 29 Aug 2019 14:07:45 +0200 Subject: [PATCH] Added method getSTG_isEntitledFor to retrieve STG by entitlement of user --- application/libraries/PermissionLib.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php index b84359216..c0e3781a4 100644 --- a/application/libraries/PermissionLib.php +++ b/application/libraries/PermissionLib.php @@ -254,6 +254,26 @@ class PermissionLib return !$this->_inLAPersonIdsBlacklist($person_id) && $this->_hasLAPermissions(); } + /** + * Returns the study programs the person is entitled for. + * @param null $berechtigung_kurzbz If given, only study programs are retrieved according to organisational units + * assigned to that permission. + * @return array|bool array of studiengang_kz the person is entitled for. False on error. + */ + public function getSTG_isEntitledFor($berechtigung_kurzbz = null) + { + $studiengang_kz_arr = array(); + + if (self::$bb->getStgKz($berechtigung_kurzbz)) + { + return $studiengang_kz_arr = self::$bb->getStgKz($berechtigung_kurzbz); + } + else + { + return false; + } + } + //------------------------------------------------------------------------------------------------------------------ // Private methods