mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Añadidos permisos a tarifas, salvo metodo delete
This commit is contained in:
@ -85,7 +85,7 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $helpers = ['session', 'go_common', 'form', 'text', 'general']; //JJO
|
||||
protected $helpers = ['session', 'go_common', 'form', 'text', 'general', 'rbac']; //JJO
|
||||
|
||||
/**
|
||||
* Initializer method.
|
||||
@ -130,29 +130,6 @@ abstract class BaseResourceController extends \CodeIgniter\RESTful\ResourceContr
|
||||
$this->viewData['alertStyle'] = $this->alertStyle;
|
||||
}
|
||||
|
||||
protected function checkPermission($sectionPermission, $redirectRoute = NULL)
|
||||
{
|
||||
// TODO ojo, con no redirigir al indexRoute, que se crea bucle!!!
|
||||
if (!auth()->user()->can($sectionPermission)) {
|
||||
$this->session->setFlashdata('errorMessage', "No tiene permisos de acceso");
|
||||
if (is_null($redirectRoute)) {
|
||||
return $this->response->redirect(route_to('home'));
|
||||
} else {
|
||||
return $this->response->redirect(route_to($redirectRoute));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function checkPermissionAJAX($sectionPermission)
|
||||
{
|
||||
|
||||
if (!auth()->user()->can($sectionPermission)) {
|
||||
return $this->fail('Error');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convenience method to display the form of a module
|
||||
* @param $forMethod
|
||||
|
||||
Reference in New Issue
Block a user