@extends('layouts.app')
@section('title', 'Talep Açma Yetki Matrisi')
@section('content')
Talep Açma Yetki Matrisi
Hangi birim veya kullanıcının hangi birim ve kategoriye talep açabileceğini yönetin.
@if (session('success'))
{{ session('success') }}
@endif
@if (session('error'))
{{ session('error') }}
@endif
@if ($errors->any())
@foreach ($errors->all() as $error)
- {{ $error }}
@endforeach
@endif
@if (!$ready || !$rulesReady)
Talep açma yetki matrisi için gerekli tablolar hazır değil.
@else
| Kaynak |
Hedef |
Etki |
Durum |
Not |
İşlem |
@forelse ($rules as $rule)
@php
$sourceLabel = strtolower((string) ($rule->source_type ?? 'unit')) === 'user'
? 'Kullanıcı: ' . ($rule->source_user_name ?: '#' . (int) ($rule->source_user_id ?? 0))
: 'Birim: ' . ((int) ($rule->source_unit_id ?? 0) === 0 ? 'Tümü' : ($rule->source_unit_name ?: '#' . (int) ($rule->source_unit_id ?? 0)));
$targetUnitLabel = (int) ($rule->target_unit_id ?? 0) === 0
? 'Tüm Birimler'
: ($rule->target_unit_name ?: '#' . (int) ($rule->target_unit_id ?? 0));
$targetCategoryLabel = $rule->target_category_name ?: 'Tüm Kategoriler';
$targetLabel = $targetUnitLabel . ' / ' . $targetCategoryLabel;
$isDeny = strtolower((string) ($rule->effect ?? 'allow')) === 'deny';
$effectLabel = $isDeny ? 'Engelle' : 'İzin Ver';
$effectClass = $isDeny ? 'text-bg-danger' : 'text-bg-success';
$isActive = !empty($rule->is_active);
$statusLabel = $isActive ? 'Aktif' : 'Pasif';
$statusClass = $isActive ? 'text-bg-primary' : 'text-bg-secondary';
@endphp
| {{ $sourceLabel }} |
{{ $targetLabel }} |
|
|
{{ $rule->note ?: '-' }} |
|
@empty
| Tanımlı yetki kuralı yok. Kural tanımlanmayan hedeflerde mevcut birim bazlı açma davranışı devam eder. |
@endforelse
@endif
@endsection
@push('styles')
@endpush
@push('scripts')
@endpush
@push('styles')
@endpush
@push('scripts')
@endpush
@push('scripts')
@endpush