-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert changes from Pull Request #4 because it caused the tool not to work properly without Gates/Policies. It only hides the tool and does not protect the routes/resources fully. Fixes #9 and resolves the need to add `vyuldashev/nova-permission` for the Gates/Policies #18. Will think about hiding Resources in the future, but added a note to the readme to hide the tool with the `canSee` method.
- Loading branch information
1 parent
5813a58
commit 39c4cc8
Showing
1 changed file
with
31 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,35 @@ | ||
<h3 class="flex items-center font-normal text-white mb-6 text-base no-underline"> | ||
<svg class="sidebar-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> | ||
<path fill="var(--sidebar-icon)" | ||
d="M7 10V7a5 5 0 1 1 10 0v3h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h2zm2 0h6V7a3 3 0 0 0-6 0v3zm-4 2v8h14v-8H5zm7 2a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1z"/> | ||
</svg> | ||
<span class="sidebar-label"> | ||
{{ __('Roles & Permissions') }} | ||
</span> | ||
</h3> | ||
|
||
@canany('viewAny', Spatie\Permission\Models\Role::class, 'viewAny', Spatie\Permission\Models\Permission::class) | ||
<h3 class="flex items-center font-normal text-white mb-6 text-base no-underline"> | ||
<svg class="sidebar-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> | ||
<path fill="var(--sidebar-icon)" | ||
d="M7 10V7a5 5 0 1 1 10 0v3h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h2zm2 0h6V7a3 3 0 0 0-6 0v3zm-4 2v8h14v-8H5zm7 2a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1z"/> | ||
</svg> | ||
<span class="sidebar-label"> | ||
{{ __('Roles & Permissions') }} | ||
</span> | ||
</h3> | ||
<ul class="list-reset mb-8"> | ||
|
||
<ul class="list-reset mb-8"> | ||
<li class="leading-wide mb-4 text-sm"> | ||
<router-link :to="{ | ||
name: 'index', | ||
params: { | ||
resourceName: 'roles' | ||
} | ||
}" class="text-white ml-8 no-underline dim"> | ||
{{ __('Roles') }} | ||
</router-link> | ||
</li> | ||
|
||
@can('viewAny', Spatie\Permission\Models\Role::class) | ||
<li class="leading-wide mb-4 text-sm"> | ||
<router-link :to="{ | ||
name: 'index', | ||
params: { | ||
resourceName: 'roles' | ||
} | ||
}" class="text-white ml-8 no-underline dim"> | ||
{{ __('Roles') }} | ||
</router-link> | ||
</li> | ||
@endcan | ||
|
||
@can('viewAny', Spatie\Permission\Models\Permission::class) | ||
<li class="leading-wide mb-4 text-sm"> | ||
<router-link :to="{ | ||
name: 'index', | ||
params: { | ||
resourceName: 'permissions' | ||
} | ||
}" class="text-white ml-8 no-underline dim"> | ||
{{ __('Permissions') }} | ||
</router-link> | ||
</li> | ||
@endcan | ||
|
||
</ul> | ||
@endcanany | ||
<li class="leading-wide mb-4 text-sm"> | ||
<router-link :to="{ | ||
name: 'index', | ||
params: { | ||
resourceName: 'permissions' | ||
} | ||
}" class="text-white ml-8 no-underline dim"> | ||
{{ __('Permissions') }} | ||
</router-link> | ||
</li> | ||
|
||
</ul> |