Added Permission Logging in Debug Mode

This commit is contained in:
oesi
2017-04-27 09:01:52 +02:00
parent 61a0a51bfa
commit 870f088549
+23 -14
View File
@@ -29,34 +29,34 @@ class PermissionLib
const INSERT_RIGHT = 'i';
const DELETE_RIGHT = 'd';
const REPLACE_RIGHT = 'ui';
private $bb; // benutzerberechtigung
private $acl; // conversion array from a source to a permission
/**
*
*
*/
function __construct()
{
// Loads CI instance
$this->ci =& get_instance();
// Loads the library to manage the rights system
//$this->ci->load->library('FHC_DB_ACL');
// Loads the auth helper
$this->ci->load->helper('fhcauth');
// Loads the array of resources
$this->acl = $this->ci->config->item('fhc_acl');
//
//
$this->bb = new benutzerberechtigung();
}
/**
* Check if the user is entitled to get access to a source with the given access type
*
*
* @return bool <b>true</b> if a user has the right to access to the specified
* resource with a specified permission type, <b>false</b> otherwise
*/
@@ -74,7 +74,7 @@ class PermissionLib
return false;
}
}
/**
* Get a permission by a given source
*/
@@ -89,16 +89,25 @@ class PermissionLib
return null;
}
}
/**
*
*
*/
private function isBerechtigt($berechtigung_kurzbz, $art = null, $oe_kurzbz = null, $kostenstelle_id = null)
{
if (!is_null($berechtigung_kurzbz))
{
$this->bb->getBerechtigungen(getAuthUID());
return $this->bb->isBerechtigt($berechtigung_kurzbz, $oe_kurzbz, $art, $kostenstelle_id);
if($this->bb->isBerechtigt($berechtigung_kurzbz, $oe_kurzbz, $art, $kostenstelle_id))
{
log_message('debug','Permission '.$berechtigung_kurzbz.' granted');
return true;
}
else
{
log_message('debug','Permission '.$berechtigung_kurzbz.' failed');
return false;
}
}
else
{