close #449 Fixed: Can't access admin if role doesn't have Settings permission
This commit is contained in:
parent
26f85cc688
commit
4f4d76cf43
@ -3,6 +3,7 @@
|
|||||||
namespace Modules\OfflinePayment\Events\Handlers;
|
namespace Modules\OfflinePayment\Events\Handlers;
|
||||||
|
|
||||||
use App\Events\AdminMenuCreated;
|
use App\Events\AdminMenuCreated;
|
||||||
|
use Auth;
|
||||||
|
|
||||||
class OfflinePaymentAdminMenu
|
class OfflinePaymentAdminMenu
|
||||||
{
|
{
|
||||||
@ -14,9 +15,14 @@ class OfflinePaymentAdminMenu
|
|||||||
*/
|
*/
|
||||||
public function handle(AdminMenuCreated $event)
|
public function handle(AdminMenuCreated $event)
|
||||||
{
|
{
|
||||||
// Add child to existing item
|
$user = Auth::user();
|
||||||
$item = $event->menu->whereTitle(trans_choice('general.settings', 2));
|
|
||||||
|
|
||||||
$item->url('apps/offlinepayment/settings', trans('offlinepayment::offlinepayment.offlinepayment'), 4, ['icon' => 'fa fa-angle-double-right']);
|
// Settings
|
||||||
|
if ($user->can(['read-settings-settings', 'read-settings-categories', 'read-settings-currencies', 'read-settings-taxes'])) {
|
||||||
|
// Add child to existing item
|
||||||
|
$item = $event->menu->whereTitle(trans_choice('general.settings', 2));
|
||||||
|
|
||||||
|
$item->url('apps/offlinepayment/settings', trans('offlinepayment::offlinepayment.offlinepayment'), 4, ['icon' => 'fa fa-angle-double-right']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user