Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
eb8ee992
Commit
eb8ee992
authored
Oct 26, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
e7005afe
'
* commit '
e7005afe
': Squashed 'Modules/User/' changes from 0fb1cbc..3b77eb6
parents
5860e1b7
e7005afe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
SidebarViewComposer.php
Modules/User/Composers/SidebarViewComposer.php
+6
-2
SentinelAuthentication.php
...les/User/Repositories/Sentinel/SentinelAuthentication.php
+10
-0
No files found.
Modules/User/Composers/SidebarViewComposer.php
View file @
eb8ee992
<?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'
)
]
]));
}
...
...
Modules/User/Repositories/Sentinel/SentinelAuthentication.php
View file @
eb8ee992
...
...
@@ -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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment