Fixed: Now checking user by prestudent_id to entitle to read DMS document

Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
Cris
2021-02-16 16:31:42 +01:00
committed by cris-technikum
parent fec8fbb6d4
commit 86a065d0d6
@@ -292,11 +292,16 @@ class requestAnrechnung extends Auth_Controller
*/
private function _checkIfEntitledToReadDMSDoc($dms_id)
{
if (!$student = getData($this->StudentModel->load(array('student_uid' => $this->_uid)))[0])
{
show_error('Failed loading Student');
}
$result = $this->AnrechnungModel->loadWhere(array('dms_id' => $dms_id));
if($result = getData($result)[0])
{
if ($result->insertvon == $this->_uid)
if ($result->prestudent_id == $student->prestudent_id)
{
return;
}