diff --git a/application/controllers/Cis/OtherLvPlan.php b/application/controllers/Cis/OtherLvPlan.php index 3fbe3e91a..c657ec3d2 100644 --- a/application/controllers/Cis/OtherLvPlan.php +++ b/application/controllers/Cis/OtherLvPlan.php @@ -14,7 +14,7 @@ class OtherLvPlan extends Auth_Controller public function __construct() { parent::__construct([ - 'index' => ['basis/cis:r'] + 'index' => ['basis/other_lv_plan:r'] ]); // Load Config diff --git a/application/controllers/api/frontend/v1/LvPlan.php b/application/controllers/api/frontend/v1/LvPlan.php index fa70e919a..99dc8bf59 100644 --- a/application/controllers/api/frontend/v1/LvPlan.php +++ b/application/controllers/api/frontend/v1/LvPlan.php @@ -98,6 +98,11 @@ class LvPlan extends FHCAPI_Controller $end_date = $this->input->post('end_date', true); $uid = $this->input->post('uid', true); + // disallow accessing other user's lv plan if missing permission + if ($uid && $uid !== getAuthUID() && !$this->permissionlib->isBerechtigt('basis/other_lv_plan')) { + $this->terminateWithError("Missing permission to view other users' timetables!"); + } + // fetching lvplan events $result = $this->stundenplanlib->getEventsUser($start_date, $end_date, $uid); $lvplanEvents = $this->getDataOrTerminateWithError($result);