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

@@ -1,24 +1,31 @@
<div class="w-full">
<div class="mb-4">For more details, please visit the <a class="underline dark:text-warning"
href="https://coolify.io/docs/knowledge-base/s3/introduction" target="_blank">Coolify Docs</a>.</div>
<form class="flex flex-col gap-2" wire:submit='submit'>
<div class="flex gap-2">
<x-forms.input required label="Name" id="name" />
<x-forms.input label="Description" id="description" />
</div>
<x-forms.input required type="url" label="Endpoint" wire:model.blur-sm="endpoint" />
<div class="flex gap-2">
<x-forms.input required label="Bucket" id="bucket" />
<x-forms.input required helper="Region only required for AWS. Leave it as-is for other providers."
label="Region" id="region" />
</div>
<div class="flex gap-2">
<x-forms.input required type="password" label="Access Key" id="key" />
<x-forms.input required type="password" label="Secret Key" id="secret" />
</div>
@can('create', App\Models\S3Storage::class)
<div class="w-full">
<div class="mb-4">For more details, please visit the <a class="underline dark:text-warning"
href="https://coolify.io/docs/knowledge-base/s3/introduction" target="_blank">Coolify Docs</a>.</div>
<form class="flex flex-col gap-2" wire:submit='submit'>
<div class="flex gap-2">
<x-forms.input required label="Name" id="name" />
<x-forms.input label="Description" id="description" />
</div>
<x-forms.input required type="url" label="Endpoint" wire:model.blur-sm="endpoint" />
<div class="flex gap-2">
<x-forms.input required label="Bucket" id="bucket" />
<x-forms.input required helper="Region only required for AWS. Leave it as-is for other providers."
label="Region" id="region" />
</div>
<div class="flex gap-2">
<x-forms.input required type="password" label="Access Key" id="key" />
<x-forms.input required type="password" label="Secret Key" id="secret" />
</div>
<x-forms.button class="mt-4" type="submit">
Validate Connection & Continue
</x-forms.button>
</form>
</div>
<x-forms.button class="mt-4" type="submit">
Validate Connection & Continue
</x-forms.button>
</form>
</div>
@else
<div class="text-gray-500 p-4 text-center">
<p>You don't have permission to create new S3 storage configurations.</p>
<p class="text-sm">Please contact your team administrator for access.</p>
</div>
@endcan

View File

@@ -19,33 +19,37 @@
@endif
</div>
</div>
<x-forms.button type="submit">
Save
</x-forms.button>
<x-forms.button canGate="update" :canResource="$storage" type="submit">Save</x-forms.button>
<x-modal-confirmation title="Confirm Storage Deletion?" isErrorButton buttonTitle="Delete"
submitAction="delete({{ $storage->id }})" :actions="[
'The selected storage location will be permanently deleted from Coolify.',
'If the storage location is in use by any backup jobs those backup jobs will only store the backup locally on the server.',
]" confirmationText="{{ $storage->name }}"
confirmationLabel="Please confirm the execution of the actions by entering the Storage Name below"
shortConfirmationLabel="Storage Name" :confirmWithPassword="false" step2ButtonText="Permanently Delete" />
@can('delete', $storage)
<x-modal-confirmation title="Confirm Storage Deletion?" isErrorButton buttonTitle="Delete"
submitAction="delete({{ $storage->id }})" :actions="[
'The selected storage location will be permanently deleted from Coolify.',
'If the storage location is in use by any backup jobs those backup jobs will only store the backup locally on the server.',
]" confirmationText="{{ $storage->name }}"
confirmationLabel="Please confirm the execution of the actions by entering the Storage Name below"
shortConfirmationLabel="Storage Name" :confirmWithPassword="false" step2ButtonText="Permanently Delete" />
@endcan
</div>
<div class="flex gap-2">
<x-forms.input label="Name" id="storage.name" />
<x-forms.input label="Description" id="storage.description" />
<x-forms.input canGate="update" :canResource="$storage" label="Name" id="storage.name" />
<x-forms.input canGate="update" :canResource="$storage" label="Description" id="storage.description" />
</div>
<div class="flex gap-2">
<x-forms.input required label="Endpoint" id="storage.endpoint" />
<x-forms.input required label="Bucket" id="storage.bucket" />
<x-forms.input required label="Region" id="storage.region" />
<x-forms.input canGate="update" :canResource="$storage" required label="Endpoint" id="storage.endpoint" />
<x-forms.input canGate="update" :canResource="$storage" required label="Bucket" id="storage.bucket" />
<x-forms.input canGate="update" :canResource="$storage" required label="Region" id="storage.region" />
</div>
<div class="flex gap-2">
<x-forms.input required type="password" label="Access Key" id="storage.key" />
<x-forms.input required type="password" label="Secret Key" id="storage.secret" />
<x-forms.input canGate="update" :canResource="$storage" required type="password" label="Access Key"
id="storage.key" />
<x-forms.input canGate="update" :canResource="$storage" required type="password" label="Secret Key"
id="storage.secret" />
</div>
<x-forms.button class="mt-4" isHighlighted wire:click="testConnection">
Validate Connection
</x-forms.button>
@can('validateConnection', $storage)
<x-forms.button class="mt-4" isHighlighted wire:click="testConnection">
Validate Connection
</x-forms.button>
@endcan
</form>
</div>

View File

@@ -4,9 +4,11 @@
</x-slot>
<div class="flex items-center gap-2">
<h1>S3 Storages</h1>
<x-modal-input buttonTitle="+ Add" title="New S3 Storage" :closeOutside="false">
<livewire:storage.create />
</x-modal-input>
@can('create', App\Models\S3Storage::class)
<x-modal-input buttonTitle="+ Add" title="New S3 Storage" :closeOutside="false">
<livewire:storage.create />
</x-modal-input>
@endcan
</div>
<div class="subtitle">S3 storages for backups.</div>
<div class="grid gap-4 lg:grid-cols-2">