diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php index dd0b2242a..662130c42 100644 --- a/application/libraries/PermissionLib.php +++ b/application/libraries/PermissionLib.php @@ -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 true if a user has the right to access to the specified * resource with a specified permission type, false 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 {