Skip to content

Download / Delete actions missing #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
stuartcusackie opened this issue Mar 11, 2024 · 9 comments
Open

Download / Delete actions missing #60

stuartcusackie opened this issue Mar 11, 2024 · 9 comments

Comments

@stuartcusackie
Copy link

stuartcusackie commented Mar 11, 2024

I noticed that the download / delete actions shown here:
https://v2.filamentphp.com/plugins/spatie-backup

Are now missing in the latest version:
https://github.com/shuvroroy/filament-spatie-laravel-backup

Allowing download would be very useful for me. Is there a way to enable this feature?

Thanks!

@Dieter91
Copy link

I second this. Without a download feature the plugin is sadly rather useless. (for me)

@fathonialimukti
Copy link

fathonialimukti commented Mar 26, 2024

Screenshot from 2024-03-26 09-04-32

check this at src/Components/BackupDestinationListRecords.php

im not sure about the specific permission required, but it would be better if it is removable or customizable, because on my case, the one can access table should have full control over it

@jgmuchiri
Copy link

@stuartcusackie @Dieter91
If you are using a package such as filament shield, you should be able to generate the policies to allow assigning the necessary permissions. If not, you can create custom gate and define who can access.

  • In boot method of your AppServiceProvider, add the following

image

  • in your .env,
BACKUP_MANAGERS=email@example.com,email2@example.com

image

@Khant-Nyar
Copy link

same here
when i check in code i found this visible(auth()->user()->can('download-backup'))
when i commit them it worked

How to make without policy or gate !

@danharper83
Copy link

I'm stuck here, does anybody have any basic instructions on how to integrate with shield?

@Khant-Nyar
Copy link

integrate

u mean this it was build for role and permissions extending from spart role and permissions .if you familiar with sparti permission it's easy

in this case you can create permissions (download-backup,delete-backup )from your own to control

@danharper83
Copy link

That's what I'm looking for, I can't figure out how to add the delete-backup and download-backup into the shield plugin UI so that I can use them in my roles.

It's not clear to me what needs to be created so that shield knows about delete-backup and download-backup

@Khant-Nyar
Copy link

That's what I'm looking for, I can't figure out how to add the delete-backup and download-backup into the shield plugin UI so that I can use them in my roles.

It's not clear to me what needs to be created so that shield knows about delete-backup and download-backup

to make a permissions it is basically sparti Permission so we can make

php artisan permission:create-permission delete-backup php artisan permission:create-permission download-backup

or make filament resource
php artisan make:model Permission
them replace Illuminate\Database\Eloquent\Model with Spatie\Permission\Models\Permission


use Spatie\Permission\Models\Permission as ModelsPermission;

class Permission extends ModelsPermission

php artisan make:filament-resource Permission --generate

now you have permissions resource to make crud process

Image

@Ivankali2020
Copy link

if you don't use shield or spatie permission this will be a simple solution. Edit on AppServiceProvider.php
public function boot(): void
{
Gate::define('download-backup', function (Admin $admin) {
return true;
});

    Gate::define('delete-backup', function (Admin $admin) {
        return true;
    });
}, But I didn't need to do for create-backup gate it already show . WHY ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants