vendredi 2 mars 2018

How to filter a permission on laravel entrust

I've got a set of roles

 [admin, dev, secretary, financial, doctor, unity].

And a lot of permissions like

[doctor-create, doctor-read, doctor-update, doctor-delete]

I've already filtered routes using middleware, example: Admin, Dev and secretary can access doctors.

Route::group(['middleware' => ['role:secretary|admin|dev']], function() {...});

But I'm on a problem, admin and dev can do anything on doctors, but the secretary cannot delete.

I've already tryed put a middleare filter on controller, but it doesn't work

$this->middleware('role:admin|dev');
$this->middleware('role:secretary')->except('delete');

How do i filter this specific permission on secretary ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire