Changed: Now checking by permission and not by benutzerfunktion

Before, permission for page access and download was checked by benutzerfunktion.
This did not allow access by user with corresponding permissions, like admins.
Therfore changed to check by permission only.
This commit is contained in:
Cris
2022-02-23 09:45:45 +01:00
parent 339f82291c
commit 09954c479c
2 changed files with 12 additions and 84 deletions
@@ -81,7 +81,7 @@ class approveAnrechnungDetail extends Auth_Controller
}
// Check if user is entitled to read the Anrechnung
self::_checkIfEntitledToReadAnrechnung($anrechnung_id);
$this->_checkIfEntitledToReadAnrechnung($anrechnung_id);
// Get Anrechung data
$anrechnungData = $this->anrechnunglib->getAnrechnungData($anrechnung_id);
@@ -390,7 +390,7 @@ class approveAnrechnungDetail extends Auth_Controller
}
// Check if user is entitled to read dms doc
self::_checkIfEntitledToReadDMSDoc($dms_id);
$this->_checkIfEntitledToReadDMSDoc($dms_id);
// Set filename to be used on downlaod
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
@@ -428,35 +428,11 @@ class approveAnrechnungDetail extends Auth_Controller
$studiengang_kz = getData($result)[0]->studiengang_kz;
// Check if user is STGL
$result = $this->StudiengangModel->getLeitung($studiengang_kz);
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))
// Check if user is entitled
if (!$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's', $studiengang_kz))
{
foreach (getData($result) as $assistance)
{
if ($assistance->uid == $this->_uid)
{
return;
}
}
show_error('You are not entitled to read this page');
}
show_error('You are not entitled to read this Anrechnung');
}
/**
@@ -478,35 +454,11 @@ class approveAnrechnungDetail extends Auth_Controller
$studiengang_kz = getData($result)[0]->studiengang_kz;
// Get STGL
$result = $this->StudiengangModel->getLeitung($studiengang_kz);
if (hasData($result))
// Check if user is entitled
if (!$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's', $studiengang_kz))
{
foreach (getData($result) as $stgl)
{
if ($stgl->uid == $this->_uid)
{
return;
}
}
show_error('You are not entitled to read this document');
}
// 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');
}
/**
@@ -249,7 +249,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
}
// Check if user is entitled to read dms doc
self::_checkIfEntitledToReadDMSDoc($dms_id);
$this->_checkIfEntitledToReadDMSDoc($dms_id);
// Set filename to be used on downlaod
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
@@ -294,35 +294,11 @@ class approveAnrechnungUebersicht extends Auth_Controller
$studiengang_kz = $result->studiengang_kz;
// Check if user is STGL
$result = $this->StudiengangModel->getLeitung($studiengang_kz);
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))
// Check if user is entitled
if (!$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's', $studiengang_kz))
{
foreach (getData($result) as $assistance)
{
if ($assistance->uid == $this->_uid)
{
return;
}
}
show_error('You are not entitled to read this document');
}
show_error('You are not entitled to read this document');
}
/**