diff --git a/application/core/FHC_Model.php b/application/core/FHC_Model.php index ef22bb689..00f59d210 100644 --- a/application/core/FHC_Model.php +++ b/application/core/FHC_Model.php @@ -95,4 +95,14 @@ class DB_Model extends FHC_Model { $this->_addonID = $addonID; } + + /** + * Method getAddonID + * + * @return string _addonID + */ + public function getAddonID() + { + return $this->_addonID; + } } \ No newline at end of file diff --git a/application/models/Nation_model.php b/application/models/Nation_model.php index 818f53fef..b9e4b9ca5 100644 --- a/application/models/Nation_model.php +++ b/application/models/Nation_model.php @@ -21,7 +21,7 @@ class Nation_model extends DB_Model // Checks if the operation is permitted by the API caller // All the code should be put inside this if statement - if(isAllowed($this->_addonID, 'person')) + if(isAllowed($this->getAddonID(), 'nation')) { $result = $this->db->query($this->_getNationQuery($notLocked, $orderEnglish)); } @@ -61,7 +61,7 @@ class Nation_model extends DB_Model // Checks if the operation is permitted by the API caller // All the code should be put inside this if statement - if(isAllowed($this->_addonID, 'person')) + if(isAllowed($this->getAddonID(), 'nation')) { $result = $this->db->query($this->_federalStateQuery); } diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 674f8964d..dcd1e57de 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -54,7 +54,7 @@ class Person_model extends DB_Model // Checks if the operation is permitted by the API caller // All the code should be put inside this if statement - if(isAllowed($this->_addonID, 'person')) + if(isAllowed($this->getAddonID(), 'person')) { if((isset($code)) && (isset($email))) { @@ -135,7 +135,7 @@ class Person_model extends DB_Model // Checks if the operation is permitted by the API caller // All the code should be put inside this if statement - if(isAllowed($this->_addonID, 'person')) + if(isAllowed($this->getAddonID(), 'person')) { if($this->_validate($person)) { @@ -331,7 +331,7 @@ class Person_model extends DB_Model { // Checks if the operation is permitted by the API caller // All the code should be put inside this if statement - if(isAllowed($this->_addonID, 'person')) + if(isAllowed($this->getAddonID(), 'person')) { return $this->_saveInterestedStudent($interestedStudent); } diff --git a/application/models/studies/Course_model.php b/application/models/studies/Course_model.php index d5b7e1673..c3fa97e62 100644 --- a/application/models/studies/Course_model.php +++ b/application/models/studies/Course_model.php @@ -33,7 +33,7 @@ class Course_model extends DB_Model // Checks if the operation is permitted by the API caller // All the code should be put inside this if statement - if(isAllowed($this->_addonID, 'person')) + if(isAllowed($this->getAddonID(), 'course')) { $result = $this->db->query($this->_enabledCoursesQuery); } diff --git a/application/models/studies/Plan_model.php b/application/models/studies/Plan_model.php index d27d7580d..151b6c144 100644 --- a/application/models/studies/Plan_model.php +++ b/application/models/studies/Plan_model.php @@ -24,7 +24,7 @@ class Plan_model extends DB_Model // Checks if the operation is permitted by the API caller // All the code should be put inside this if statement - if(isAllowed($this->_addonID, 'person')) + if(isAllowed($this->getAddonID(), 'plan')) { $result = $this->db->query($this->_planQuery, array($courseOfStudiesID)); }