Updated shelf menu item to show on custom permission

- Extended new 'userCanOnAny' helper to take a entity class for
filtering.

Closes #1201
This commit is contained in:
Dan Brown
2019-03-09 21:15:45 +00:00
parent 04287745e4
commit 042a6f9760
4 changed files with 39 additions and 12 deletions

View File

@ -48,7 +48,7 @@
</form>
</div>
<div class="links text-center">
@if(userCan('bookshelf-view-all') || userCan('bookshelf-view-own'))
@if(userCanOnAny('view', \BookStack\Entities\Bookshelf::class) || userCan('bookshelf-view-own'))
<a href="{{ baseUrl('/shelves') }}">@icon('bookshelf'){{ trans('entities.shelves') }}</a>
@endif
<a href="{{ baseUrl('/books') }}">@icon('book'){{ trans('entities.books') }}</a>