- 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:
Paolo
2018-03-29 12:23:05 +02:00
parent 042f187818
commit dda27c7d6e
3 changed files with 7 additions and 31 deletions
+1 -1
View File
@@ -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);
}