- Removed permission system from DB_Model and FHC_Model

- Removed method _isEntitled from DB_Model
- Removed method isEntitled from DHC_Model
This commit is contained in:
Paolo
2018-03-29 12:15:12 +02:00
parent d9b80b790d
commit 4152a67d8f
2 changed files with 0 additions and 72 deletions
-35
View File
@@ -19,40 +19,5 @@ class FHC_Model extends CI_Model
// Load return message helper
$this->load->helper('message');
// Loads the permission library
$this->load->library('PermissionLib');
}
/**
* Check if the user is entitled to get access to a source with the given access type
* This is a wrapper for the same method present in the PermissionLib
*/
public function isEntitled($sourceName, $accessType, $languageMessageCode, $msgErrorCode)
{
$isEntitled = success(true);
// If script is not called from Commandline
// or the caller is _not_ a model _and_ tries to read data, then avoids to check permissions
// Otherwise checks always the permissions
if (!is_cli() ||
($accessType == PermissionLib::SELECT_RIGHT
&& substr(get_called_class(), -6) == DB_Model::MODEL_POSTFIX)
|| $accessType != PermissionLib::SELECT_RIGHT)
{
if ($this->permissionlib->isEntitled($sourceName, $accessType) === false)
{
$retval = sprintf(
'%s -> %s:%s',
lang('fhc_'.$languageMessageCode),
$this->permissionlib->getBerechtigungKurzbz($sourceName),
$accessType
);
$isEntitled = error($retval, $msgErrorCode);
}
}
return $isEntitled;
}
}