Commit eb8ee992 authored by Nicolas Widart's avatar Nicolas Widart

Merge commit 'e7005afe'

* commit 'e7005afe':
  Squashed 'Modules/User/' changes from 0fb1cbc..3b77eb6
parents 5860e1b7 e7005afe
<?php namespace Modules\User\Composers;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Request;
use Illuminate\View\View;
use Modules\Core\Composers\BaseSidebarViewComposer;
class SidebarViewComposer
class SidebarViewComposer extends BaseSidebarViewComposer
{
public function compose(View $view)
{
......@@ -15,18 +16,21 @@ class SidebarViewComposer
'route' => '#',
'icon-class' => 'fa fa-user',
'title' => 'Users & Roles',
'permission' => $this->auth->hasAccess('users.index') or $this->auth->hasAccess('roles.index')
],
[
'request' => "*/{$view->prefix}/users*",
'route' => 'dashboard.user.index',
'icon-class' => 'fa fa-user',
'title' => 'Users',
'permission' => $this->auth->hasAccess('users.index')
],
[
'request' => "*/{$view->prefix}/roles*",
'route' => 'dashboard.role.index',
'icon-class' => 'fa fa-flag-o',
'title' => 'Roles',
'permission' => $this->auth->hasAccess('roles.index')
]
]));
}
......
......@@ -106,4 +106,14 @@ class SentinelAuthentication implements Authentication
{
return Reminder::complete($user, $code, $password);
}
/**
* Determines if the current user has access to given permission
* @param $permission
* @return bool
*/
public function hasAccess($permission)
{
return Sentinel::hasAccess($permission);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment