-
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.
Merge pull request #4 from fbrissi/bugfix/view_any_role_and_premission
Implementation hide Roles and Permissions in menu when with viewAny.
- Loading branch information
Showing
1 changed file
with
38 additions
and
31 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,36 +1,43 @@ | ||
|
||
<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 | ||
|
||
<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> | ||
@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 | ||
|
||
</ul> |