Update on security, user to edit their own system
This commit is contained in:
@@ -217,7 +217,9 @@
|
||||
@if(($x=$oo->systems->where('pivot.default',TRUE))->count() && ($x->first()->id !== $o->id))
|
||||
<i class="bi bi-dash-square"></i>
|
||||
@else
|
||||
<span class="default" itemid="{{ $oo->id }}"><i class="bi bi-{{ $x->count() ? 'check-square' : 'square' }}"></i></span>
|
||||
@can('admin')
|
||||
<span class="default" itemid="{{ $oo->id }}"><i class="bi bi-{{ $x->count() ? 'check-square' : 'square' }}"></i></span>
|
||||
@endcan
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $oo->pivot->sespass }}</td>
|
||||
@@ -603,6 +605,7 @@
|
||||
@section('page-scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
@can('admin')
|
||||
$('.default').click(function () {
|
||||
var item = this;
|
||||
icon = $(item).find('i');
|
||||
@@ -634,6 +637,7 @@
|
||||
cache: false
|
||||
})
|
||||
});
|
||||
@endcan
|
||||
$('data.validated').on('click',function(item) {
|
||||
that = $(this);
|
||||
var values = item.delegateTarget.value.split(':');
|
||||
|
@@ -42,7 +42,7 @@
|
||||
<tbody>
|
||||
@foreach (\App\Models\System::active()->with(['addresses.zone.domain'])->get() as $oo)
|
||||
<tr>
|
||||
<td><a href="{{ url('system/addedit',[$oo->id]) }}" @cannot('update',$oo)class="disabled" @endcannot>{{ $oo->id }}</a></td>
|
||||
<td><a href="{{ url('system/addedit',[$oo->id]) }}" @cannot('update_nn',$oo)class="disabled" @endcannot>{{ $oo->id }}</a></td>
|
||||
<td>{{ $oo->name }} @if(! $oo->active)<span class="float-end"><small>[i]</small></span>@endif</td>
|
||||
<td>{{ $oo->sysop }}</td>
|
||||
<td>{{ $oo->location }}</td>
|
||||
|
@@ -1,6 +1,10 @@
|
||||
<!-- $o = System::class -->
|
||||
@if(($x=\App\Models\Zone::active()
|
||||
->whereIn('id',$o->zones->pluck('id'))
|
||||
@php
|
||||
use App\Models\Zone;
|
||||
@endphp
|
||||
|
||||
@if(($x=Zone::active()
|
||||
->whereIn('id',$o->addresses->pluck('zone.id'))
|
||||
->whereNotIn('id',$o->sessions->pluck('id'))
|
||||
->with(['domain'])
|
||||
->get())->count())
|
||||
|
Reference in New Issue
Block a user