- application/core/* -> CS compliant

- application/libraries/* -> CS compliant
- FHC_Model isEntitled method now return error() or success()
- Updated all code that uses isEntitled method from FHC_Model
- Removed Squiz.PHP.DisallowSizeFunctionsInLoops from CS ruleset
- Removed depracated method replace from DB_Model
- Removed unused method pgArrayPhp from DB_Model
- Renamed method arrayMergeIndex to _arrayCombine in DB_Model and set as private
- Added method _manageUDFs to DB_Model (a wrapper for UDFLib->manageUDFs)
This commit is contained in:
Paolo
2017-08-22 16:24:51 +02:00
parent 36ab348951
commit d8cd786079
35 changed files with 672 additions and 768 deletions
+14 -15
View File
@@ -37,7 +37,7 @@ class PermissionLib
* PermissionLib's constructor
* Here is initialized the static property bb with all the rights of the user (API caller)
*/
function __construct()
public function __construct()
{
// Loads CI instance
$this->ci =& get_instance();
@@ -64,17 +64,16 @@ class PermissionLib
*/
public function isEntitled($sourceName, $permissionType)
{
$isEntitled = false;
// If the resource exists
if (isset($this->acl[$sourceName]))
{
// Checks permission
return $this->_isBerechtigt($this->acl[$sourceName], $permissionType);
}
// if the resource does not exist, do not lose useful clock cycles
else
{
return false;
$isEntitled = $this->_isBerechtigt($this->acl[$sourceName], $permissionType);
}
return $isEntitled;
}
/**
@@ -82,26 +81,26 @@ class PermissionLib
*/
public function getBerechtigungKurzbz($sourceName)
{
$returnValue = null;
if (isset($this->acl[$sourceName]))
{
return $this->acl[$sourceName];
}
else
{
return null;
$returnValue = $this->acl[$sourceName];
}
return $returnValue;
}
/**
* Checks user's (API caller) rights
*/
private function _isBerechtigt($berechtigung_kurzbz, $art = null, $oe_kurzbz = null, $kostenstelle_id = null)
private function _isBerechtigt($berechtigung_kurzbz, $art = null, $oe_kurzbz = null, $kostenstelle_id = null)
{
$isBerechtigt = false;
if (!is_null($berechtigung_kurzbz))
{
if(self::$bb->isBerechtigt($berechtigung_kurzbz, $oe_kurzbz, $art, $kostenstelle_id))
if (self::$bb->isBerechtigt($berechtigung_kurzbz, $oe_kurzbz, $art, $kostenstelle_id))
{
$isBerechtigt = true;
}
@@ -109,4 +108,4 @@ class PermissionLib
return $isBerechtigt;
}
}
}