diff --git a/app/Http/ViewComposers/All.php b/app/Http/ViewComposers/All.php index afa649aba..4dcaabe7b 100644 --- a/app/Http/ViewComposers/All.php +++ b/app/Http/ViewComposers/All.php @@ -18,9 +18,16 @@ class All public function compose(View $view) { // Make sure it's installed - if (env('APP_INSTALLED')) { - // Share date format - $view->with(['date_format' => $this->getCompanyDateFormat()]); + if (!env('APP_INSTALLED')) { + return; } + + // Share user logged in + $auth_user = auth()->user(); + + // Share date format + $date_format = $this->getCompanyDateFormat(); + + $view->with(['auth_user' => $auth_user, 'date_format' => $date_format]); } } diff --git a/resources/views/banking/accounts/index.blade.php b/resources/views/banking/accounts/index.blade.php index ba3ae143a..0883ee374 100644 --- a/resources/views/banking/accounts/index.blade.php +++ b/resources/views/banking/accounts/index.blade.php @@ -41,7 +41,11 @@ @foreach($accounts as $item) + @if ($auth_user->can('read-reports-income-expense-summary')) + {{ $item->name }} + @else {{ $item->name }} + @endif {{ $item->number }} @money($item->balance, $item->currency_code, true) diff --git a/resources/views/common/dashboard/index.blade.php b/resources/views/common/dashboard/index.blade.php index a7c221d87..f1508d715 100644 --- a/resources/views/common/dashboard/index.blade.php +++ b/resources/views/common/dashboard/index.blade.php @@ -7,7 +7,11 @@
+ @if ($auth_user->can('read-reports-income-summary')) + + @else + @endif
{{ trans('dashboard.total_incomes') }} @@ -26,7 +30,11 @@
+ @if ($auth_user->can('read-reports-expense-summary')) + + @else + @endif
{{ trans('dashboard.total_expenses') }} @@ -46,7 +54,11 @@
+ @if ($auth_user->can('read-reports-income-expense-summary')) + + @else + @endif
{{ trans('dashboard.total_profit') }} diff --git a/resources/views/expenses/vendors/index.blade.php b/resources/views/expenses/vendors/index.blade.php index 42dd09b56..2164c9c4d 100644 --- a/resources/views/expenses/vendors/index.blade.php +++ b/resources/views/expenses/vendors/index.blade.php @@ -62,6 +62,9 @@