Update on security, user to edit their own system

This commit is contained in:
2024-05-18 08:27:17 +10:00
parent 29710c37c2
commit 59ec5f5a0c
8 changed files with 85 additions and 39 deletions

View File

@@ -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(':');