Open crofton77 opened 10 years ago
As I could not see a way to set access to display menu items I made some changes to the code.
I added the following code to the foreach loop in the buildMenu Function.
$allowed = false; if(isset($value['permissions'])){ $permissions = explode(',',$value['permissions']); foreach($permissions AS $p){ if(\Auth::user()->hasPermission($p)){ $allowed = true; } } } else{ $allowed = true; }
I also added the permissions option to the menu config array
'title' => trans('bauhaususer::admin.menu'), 'permissions' => 'manage_users', 'children' => [
As I could not see a way to set access to display menu items I made some changes to the code.
I added the following code to the foreach loop in the buildMenu Function.
I also added the permissions option to the menu config array