mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
8e0ca12deb
- All return messages functions are in the message helper and it is loaded by the core classes - Added the missing constant FHC_NOPK - Updated all the interested classes with the new permission method - Updated all the interested classes with the new return message functions
43 lines
1001 B
PHP
43 lines
1001 B
PHP
<?php
|
|
|
|
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
class FHC_Model extends CI_Model
|
|
{
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
|
|
// Load languages files
|
|
$this->lang->load('fhc_model');
|
|
$this->lang->load('fhcomplete');
|
|
|
|
// 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)
|
|
{
|
|
if ($this->permissionlib->isEntitled($sourceName, $accessType) === false)
|
|
{
|
|
$retval = sprintf(
|
|
'%s -> %s:%s',
|
|
lang('fhc_' . $languageMessageCode),
|
|
$this->permissionlib->getBerechtigungKurzbz($sourceName),
|
|
$accessType
|
|
);
|
|
return error($retval, $msgErrorCode);
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
} |