Stop asset acceptances from shown to user if full company support is enabled and companies not match

This commit is contained in:
Ivan Nieto Vivanco 2023-08-02 19:22:35 -06:00
parent 924f5287f7
commit 9ca163e8cf
3 changed files with 4 additions and 1 deletions

View file

@ -69,7 +69,7 @@ class AcceptanceController extends Controller
}
if (! Company::isCurrentUserHasAccess($acceptance->checkoutable)) {
return redirect()->route('account.accept')->with('error', trans('general.insufficient_permissions'));
return redirect()->route('account.accept')->with('error', trans('general.error_user_company'));
}
return view('account/accept.create', compact('acceptance'));

View file

@ -452,6 +452,7 @@ return [
'serial_number' => 'Serial Number',
'item_notes' => ':item Notes',
'item_name_var' => ':item Name',
'error_user_company' => 'User and Asset companies missmatch',
'importer' => [
'checked_out_to_fullname' => 'Checked Out to: Full Name',
'checked_out_to_first_name' => 'Checked Out to: First Name',

View file

@ -41,9 +41,11 @@
<tbody>
@foreach ($acceptances as $acceptance)
<tr>
@if ($acceptance->checkoutable)
<td>{{ ($acceptance->checkoutable) ? $acceptance->checkoutable->present()->name : '' }}</td>
<td><a href="{{ route('account.accept.item', $acceptance) }}" class="btn btn-default btn-sm">{{ trans('general.accept_decline') }}</a></td>
</tr>
@endif
@endforeach
</tbody>
</table>