fixed table action permission issue
This commit is contained in:
parent
4f31721396
commit
311b6c7da8
@ -548,7 +548,7 @@ class Company extends Eloquent implements Ownable
|
||||
'title' => trans('general.switch'),
|
||||
'icon' => 'settings_ethernet',
|
||||
'url' => route('companies.switch', $this->id),
|
||||
'permission' => 'read-common-companies',
|
||||
//'permission' => 'read-common-companies', remove this permission to allow switching to any company
|
||||
'attributes' => [
|
||||
'id' => 'index-line-actions-switch-company-' . $this->id,
|
||||
],
|
||||
|
@ -8,14 +8,15 @@
|
||||
@else
|
||||
<div class="absolute ltr:right-12 rtl:left-12 -top-4 hidden items-center group-hover:flex">
|
||||
@foreach ($actions as $action)
|
||||
@if (! empty($action['permission']))
|
||||
@can($action['permission'])
|
||||
@endif
|
||||
|
||||
@if ($count_buttons > 3 && $loop->count > 4)
|
||||
@break
|
||||
@endif
|
||||
|
||||
@if (
|
||||
empty($action['permission'])
|
||||
|| (! empty($action['permission']) && user()->can($action['permission']))
|
||||
)
|
||||
|
||||
@php
|
||||
$type = ! empty($action['type']) ? $action['type'] : 'link';
|
||||
@endphp
|
||||
@ -63,18 +64,14 @@
|
||||
|
||||
$count_buttons++;
|
||||
@endphp
|
||||
|
||||
@if (! empty($action['permission']))
|
||||
@endcan
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@foreach ($actions as $action)
|
||||
@if (! empty($action['permission']))
|
||||
@can($action['permission'])
|
||||
@php $more_actions[] = $action; @endphp
|
||||
@endcan
|
||||
@else
|
||||
@if (
|
||||
empty($action['permission'])
|
||||
|| (! empty($action['permission']) && user()->can($action['permission']))
|
||||
)
|
||||
@php $more_actions[] = $action; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
|
Loading…
x
Reference in New Issue
Block a user