feat(acl): Change views/backend code to able to use proper ACL's later on. Currently it is not enabled.

This commit is contained in:
Andras Bacsai
2025-08-26 10:27:31 +02:00
parent 5a88377a67
commit 63fcc0ebc3
159 changed files with 3610 additions and 1922 deletions

View File

@@ -7,32 +7,34 @@
<form class="flex flex-col" wire:submit='changePrivateKey'>
<div class="flex items-start gap-2">
<h2 class="pb-4">Private Key</h2>
<x-forms.button type="submit">
<x-forms.button canGate="update" :canResource="$private_key" type="submit">
Save
</x-forms.button>
@if (data_get($private_key, 'id') > 0)
<x-modal-confirmation title="Confirm Private Key Deletion?" isErrorButton buttonTitle="Delete"
submitAction="delete({{ $private_key->id }})" :actions="[
'This private key will be permanently deleted.',
'All servers connected to this private key will stop working.',
'Any git app using this private key will stop working.',
]"
confirmationText="{{ $private_key->name }}"
confirmationLabel="Please confirm the execution of the actions by entering the Private Key Name below"
shortConfirmationLabel="Private Key Name" :confirmWithPassword="false"
step2ButtonText="Delete Private Key" />
@can('delete', $private_key)
<x-modal-confirmation title="Confirm Private Key Deletion?" isErrorButton buttonTitle="Delete"
submitAction="delete({{ $private_key->id }})" :actions="[
'This private key will be permanently deleted.',
'All servers connected to this private key will stop working.',
'Any git app using this private key will stop working.',
]"
confirmationText="{{ $private_key->name }}"
confirmationLabel="Please confirm the execution of the actions by entering the Private Key Name below"
shortConfirmationLabel="Private Key Name" :confirmWithPassword="false"
step2ButtonText="Delete Private Key" />
@endcan
@endif
</div>
<div class="flex flex-col gap-2">
<div class="flex gap-2">
<x-forms.input id="private_key.name" label="Name" required />
<x-forms.input id="private_key.description" label="Description" />
<x-forms.input canGate="update" :canResource="$private_key" id="private_key.name" label="Name" required />
<x-forms.input canGate="update" :canResource="$private_key" id="private_key.description" label="Description" />
</div>
<div>
<div class="flex items-end gap-2 py-2 ">
<div class="pl-1">Public Key</div>
</div>
<x-forms.input readonly id="public_key" />
<x-forms.input canGate="update" :canResource="$private_key" readonly id="public_key" />
<div class="flex items-end gap-2 py-2 ">
<div class="pl-1">Private Key <span class='text-helper'>*</span></div>
<div class="text-xs underline cursor-pointer dark:text-white" x-cloak x-show="!showPrivateKey"
@@ -50,11 +52,11 @@
</div>
@endif
<div x-cloak x-show="!showPrivateKey">
<x-forms.input allowToPeak="false" type="password" rows="10" id="private_key.private_key"
<x-forms.input canGate="update" :canResource="$private_key" allowToPeak="false" type="password" rows="10" id="private_key.private_key"
required disabled />
</div>
<div x-cloak x-show="showPrivateKey">
<x-forms.textarea rows="10" id="private_key.private_key" required />
<x-forms.textarea canGate="update" :canResource="$private_key" rows="10" id="private_key.private_key" required />
</div>
</div>
</div>