mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 10:22:18 +00:00
Added a check of the user permissions in the FHC_Controller
- FHC_Controller includes PermissionLib - Added new method _isAllowed to FHC_Controller - Added permission _checkPermissions to FHC_Controller - Added new constants to PermissionLib
This commit is contained in:
@@ -23,13 +23,20 @@ require_once(FHCPATH.'include/benutzerberechtigung.class.php');
|
||||
|
||||
class PermissionLib
|
||||
{
|
||||
// Available rights
|
||||
// Available rights in the DB
|
||||
const SELECT_RIGHT = 's';
|
||||
const UPDATE_RIGHT = 'u';
|
||||
const INSERT_RIGHT = 'i';
|
||||
const DELETE_RIGHT = 'd';
|
||||
const REPLACE_RIGHT = 'ui';
|
||||
|
||||
// Available rights to access a controller
|
||||
const READ_RIGHT = 'r';
|
||||
const WRITE_RIGHT = 'w';
|
||||
const READ_WRITE_RIGHT = 'rw';
|
||||
|
||||
const PERMISSION_SEPARATOR = ':'; // used as separator berween permission and right
|
||||
|
||||
private $acl; // conversion array from a source to a permission
|
||||
private static $bb; // benutzerberechtigung
|
||||
|
||||
@@ -42,9 +49,6 @@ class PermissionLib
|
||||
// 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');
|
||||
|
||||
@@ -69,7 +73,8 @@ class PermissionLib
|
||||
{
|
||||
$isEntitled = false;
|
||||
|
||||
if(!is_cli())
|
||||
// If it's called from command line than it's trusted
|
||||
if (!is_cli())
|
||||
{
|
||||
// If the resource exists
|
||||
if (isset($this->acl[$sourceName]))
|
||||
|
||||
Reference in New Issue
Block a user