mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-21 05:59:27 +00:00
Changed permission function to allow stgl assistance download on Uebersicht- and Detailseite
This commit is contained in:
@@ -471,21 +471,35 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
'lehrveranstaltung_id' => $result->lehrveranstaltung_id
|
||||
));
|
||||
|
||||
if(!$result = getData($result)[0])
|
||||
{
|
||||
show_error('Failed loading Lehrveranstaltung');
|
||||
}
|
||||
$studiengang_kz = getData($result)[0]->studiengang_kz;
|
||||
|
||||
// Get STGL
|
||||
$result = $this->StudiengangModel->getLeitung($result->studiengang_kz);
|
||||
$result = $this->StudiengangModel->getLeitung($studiengang_kz);
|
||||
|
||||
if($result = getData($result)[0])
|
||||
{
|
||||
if ($result->uid == $this->_uid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $stgl)
|
||||
{
|
||||
if ($stgl->uid == $this->_uid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if user is Assistance
|
||||
$result = $this->StudiengangModel->getAssistance($studiengang_kz);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $assistance)
|
||||
{
|
||||
if ($assistance->uid == $this->_uid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
show_error('You are not entitled to read this document');
|
||||
}
|
||||
|
||||
@@ -281,9 +281,11 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
show_error('Failed loading Lehrveranstaltung');
|
||||
}
|
||||
|
||||
$studiengang_kz = $result->studiengang_kz;
|
||||
|
||||
// Get STGL
|
||||
$result = $this->StudiengangModel->getLeitung($result->studiengang_kz);
|
||||
// Check if user is STGL
|
||||
$result = $this->StudiengangModel->getLeitung($studiengang_kz);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
@@ -295,6 +297,20 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if user is Assistance
|
||||
$result = $this->StudiengangModel->getAssistance($studiengang_kz);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $assistance)
|
||||
{
|
||||
if ($assistance->uid == $this->_uid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
show_error('You are not entitled to read this document');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user