- phpC(d)I

- Renamed method chkRights to _isEntitled in model DB_Model
- Updated models where it was needed
This commit is contained in:
bison-paolo
2016-10-20 16:37:52 +02:00
parent 39b4c8057d
commit 5087826891
20 changed files with 152 additions and 126 deletions
@@ -18,10 +18,10 @@ class Studiengang_model extends DB_Model
public function getAllForBewerbung()
{
// Checks if the operation is permitted by the API caller
if (($chkRights = $this->isEntitled('lehre.vw_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
return $chkRights;
if (($chkRights = $this->isEntitled('bis.tbl_lgartcode', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
return $chkRights;
if (($isEntitled = $this->isEntitled('lehre.vw_studienplan', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
return $isEntitled;
if (($isEntitled = $this->isEntitled('bis.tbl_lgartcode', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
return $isEntitled;
$allForBewerbungQuery = 'SELECT DISTINCT studiengang_kz,
typ,
@@ -15,7 +15,8 @@ class Studiensemester_model extends DB_Model
public function getLastOrAktSemester($days = 60)
{
// Checks rights
if ($chkRights = $this->chkRights(PermissionLib::SELECT_RIGHT)) return $chkRights;
if (($isEntitled = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
return $isEntitled;
if (!is_numeric($days))
{
@@ -34,7 +35,8 @@ class Studiensemester_model extends DB_Model
public function getNextFrom($studiensemester_kurzbz)
{
// Checks rights
if ($chkRights = $this->chkRights(PermissionLib::SELECT_RIGHT)) return $chkRights;
if (($isEntitled = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
return $isEntitled;
$query = 'SELECT studiensemester_kurzbz,
start,
@@ -57,8 +59,8 @@ class Studiensemester_model extends DB_Model
public function getNearest($semester = '')
{
// Checks if the operation is permitted by the API caller
if (($chkRights = $this->isEntitled('public.vw_studiensemester', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
return $chkRights;
if (($isEntitled = $this->isEntitled('public.vw_studiensemester', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
return $isEntitled;
$query = 'SELECT studiensemester_kurzbz,
start,