@extends('layouts.app') @section('title') {{ __('Phân quyền đối tác') }} @endsection @section('section.header')

{{ __('Phân quyền đối tác') }}

{{ __('Bật tắt quyền của tài khoản Đối tác và Quản lý đối tác. Lưu xong là áp dụng ngay.') }}
@endsection @section('section.content')
@if (Session::has('success'))
{{ Session::get('success') }}
@endif @if (Session::has('error'))
{{ Session::get('error') }}
@endif @if (!empty($missing))
{{ __('Thiếu bản ghi permission:') }} {{ implode(', ', $missing) }}. {{ __('Hãy chạy lệnh php artisan migrate rồi tải lại trang, nếu không tích vào các quyền này sẽ không lưu được.') }}
@endif
{{-- ========================== QUYỀN CHUNG ========================== --}}
{{ __('Áp dụng cho mọi tài khoản mang vai trò đó, trừ tài khoản đã bật quyền riêng ở tab bên cạnh.') }}
@csrf
@foreach ($roles as $roleKey => $roleLabel) @endforeach @foreach ($groups as $group) @foreach ($roles as $roleKey => $roleLabel) @php $applicable = collect($group['items']) ->filter(fn ($i) => in_array($roleKey, $i['roles'], true)); @endphp @endforeach @foreach ($group['items'] as $item) @foreach ($roles as $roleKey => $roleLabel) @endforeach @endforeach @endforeach
{{ __('Quyền / thao tác') }} {{ $roleLabel }}
{{ $counts[$roleKey]['on'] }}/{{ $counts[$roleKey]['total'] }}
{{ $group['label'] }} @if ($applicable->isNotEmpty()) @else — @endif
{{ $item['label'] }}
{{ $item['note'] }}
@if (in_array($roleKey, $item['roles'], true))
@else — @endif
{{-- ========================= QUYỀN RIÊNG ========================== --}}
{{ __('Tài khoản bật quyền riêng sẽ ăn theo bộ quyền của chính nó và bỏ qua quyền chung.') }}
@forelse ($accounts as $account) @empty @endforelse
{{ __('Tài khoản') }} {{ __('Vai trò') }} {{ __('Nguồn quyền') }} {{ __('Đang bật') }}
{{ $account->username }} @if ($account->is_banned) {{ __('Khoá') }} @endif {{ $account->role_label }} @if ($account->custom) {{ __('Quyền riêng') }} @else {{ __('Quyền chung') }} @endif {{ $account->on }}/{{ $account->total }} {{ __('Chỉnh') }}
{{ __('Chưa có tài khoản đối tác hoặc quản lý đối tác nào.') }}
@endsection @section('styles') @endsection @section('scripts') @endsection