mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 09:52:22 +00:00
- 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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user