mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 00:54:27 +00:00
- Removed method isEntitled from PermissionLib
- Renamed method checkPermissions to isEntitled - isEntitled: if the controller is called from the command line, then is always trusted - Adapted controllers application/core/APIv1_Controller.php and application/core/FHC_Controller.php
This commit is contained in:
@@ -29,7 +29,7 @@ class APIv1_Controller extends REST_Controller
|
||||
*/
|
||||
private function _isAllowed($requiredPermissions)
|
||||
{
|
||||
if (!$this->permissionlib->checkPermissions($requiredPermissions, $this->router->method))
|
||||
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method))
|
||||
{
|
||||
$this->response(error('You are not allowed to access to this content'), REST_Controller::HTTP_UNAUTHORIZED);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class FHC_Controller extends CI_Controller
|
||||
*/
|
||||
private function _isAllowed($requiredPermissions)
|
||||
{
|
||||
if (!$this->permissionlib->checkPermissions($requiredPermissions, $this->router->method))
|
||||
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method))
|
||||
{
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
echo 'You are not allowed to access to this content';
|
||||
|
||||
Reference in New Issue
Block a user