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